Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check_ip_address.r2py to validate IP address #9

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b98972f
Update integrationtestlib.py
aot221 Jul 15, 2014
e5b25d9
(Work in Progress)
aot221 Jul 31, 2014
e06d092
WIP - Currently being debugged
aot221 Aug 5, 2014
79efd33
New integrationtestlib that utilizes a file for the notify list of em…
aot221 Aug 7, 2014
f46ed88
Update integrationtestlib.py
aot221 Aug 7, 2014
fcbd07b
Delete selexor_active.py
aot221 Aug 7, 2014
edea25e
Update integrationtestlib.py
aot221 Aug 7, 2014
a676f22
Update integrationtestlib.py
aot221 Aug 7, 2014
2158e6f
Create centralizedputget.py
aot221 Aug 11, 2014
fd44ef3
Updated to make sure that the ret_value is correct
aot221 Aug 12, 2014
ce3b110
Create centralizedadvertise.repy
aot221 Aug 12, 2014
500e346
Create dorputget_new.py
aot221 Aug 12, 2014
87a3287
Update integrationtestlib.py
aot221 Aug 26, 2014
784c42c
Update integrationtestlib.py
aot221 Aug 26, 2014
6f391a5
Update integrationtestlib.py
aot221 Aug 26, 2014
a9460be
Update integrationtestlib.py
aot221 Aug 26, 2014
68d0914
Update integrationtestlib.py
aot221 Aug 26, 2014
a7bd41c
Now utilizes an "email_address_list_file" to read in emails.
aot221 Aug 27, 2014
a26d4a9
Removed as we do not use DOR code in production and we do not need mo…
asm582 Sep 28, 2014
ce45187
Add exception for socket timeout bug
asm582 Sep 28, 2014
767d29b
Revert "Add exception for socket timeout bug"
asm582 Sep 28, 2014
58d5e9e
Add socket timeout exception
asm582 Sep 28, 2014
72ceecf
add proper exception as it is repy file
asm582 Sep 28, 2014
5109e05
Update monitor_processes.py
asm582 Sep 30, 2014
7b9200e
Add file with changes of exception and cleaned irc imports from code.
asm582 Oct 4, 2014
7b3075c
Cleaned irc import code
asm582 Oct 4, 2014
3f29f67
Add file not found exception in the file
asm582 Oct 4, 2014
fff865b
change in variable named gmail_file_name to read gmail username and p…
asm582 Oct 4, 2014
d0dc94b
Create ut_seash_send_gmail.py
asm582 Oct 13, 2014
ebd6bd5
Update ut_seash_send_gmail.py
asm582 Oct 13, 2014
a1261d2
Added check_ip_address.r2py to validate IP address
asm582 Oct 17, 2014
67d3ffe
Added ut_monitor_send_gmail.py for unit testing
asm582 Oct 17, 2014
9a165d1
Update ut_monitor_send_gmail.py
asm582 Oct 17, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions centralizedadvertise.repy
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
Author: Justin Cappos

Start Date: July 8, 2008

Description:
Advertisements to a central server (similar to openDHT)


"""

include session.repy
# I'll use socket timeout to prevent hanging when it takes a long time...
include sockettimeout.repy
servername = "satya.cs.washington.edu"
serverport = 10101

def centralizedadvertise_announce(key, value, ttlval):

sockobj = timeout_openconn(servername,serverport, timeout=10)
try:
session_sendmessage(sockobj, "PUT|"+str(key)+"|"+str(value)+"|"+str(ttlval))
response = session_recvmessage(sockobj)
if response != 'OK':
raise Exception, "Centralized announce failed '"+response+"'"
except SocketTimeoutError:
print "Socket timed out '"+response+"'"
finally:
# BUG: This raises an error right now if the call times out ( #260 )
# This isn't a big problem, but it is the "wrong" exception
sockobj.close()

return True




def centralizedadvertise_lookup(key, maxvals=100):
sockobj = timeout_openconn(servername,serverport, timeout=10)
try:
session_sendmessage(sockobj, "GET|"+str(key)+"|"+str(maxvals))
recvdata = session_recvmessage(sockobj)
# worked
if recvdata.endswith('OK'):
return recvdata[:-len('OK')].split(',')
raise Exception, "Centralized lookup failed"

finally:
# BUG: This raises an error right now if the call times out ( #260 )
# This isn't a big problem, but it is the "wrong" exception
sockobj.close()



Loading