Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Elijah Grubb
emulab-devel
Commits
33da8a98
Commit
33da8a98
authored
Dec 29, 2015
by
Kirk Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow specification of server in geni-get (-s server).
Also update my mothership defs file.
parent
f25d292f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
clientside/protogeni/geni-get
clientside/protogeni/geni-get
+18
-11
defs-kwebb-emulab
defs-kwebb-emulab
+5
-4
No files found.
clientside/protogeni/geni-get
View file @
33da8a98
...
...
@@ -45,6 +45,7 @@ def usage():
print
" -c, --client-version display client version"
print
" -h, --help show this message"
print
" -n, --no-cache disable reading cached results"
print
" -s, --server specify server name/address"
print
" -p, --port specify server port"
print
" -v, --version display server version"
print
""
...
...
@@ -60,12 +61,13 @@ def dump( sock ):
sock
.
close
()
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:
],
"achn
p:v"
,
[
"all"
,
"client-version"
,
"help"
,
"no-cache
"
,
"port="
,
"version"
]
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:
],
"achn
s:p:v"
,
[
"all"
,
"client-version"
,
"help"
,
"no-cache"
,
"server=
"
,
"port="
,
"version"
]
)
except
getopt
.
GetoptError
as
err
:
print
str
(
err
)
usage
()
sys
.
exit
(
1
)
server
=
None
port
=
PORT
command
=
None
...
...
@@ -81,6 +83,8 @@ for opt, param in opts:
elif
opt
in
(
"-n"
,
"--no-cache"
):
# Ignored; we don't currently cache anyway...
pass
elif
opt
in
(
"-s"
,
"--server"
):
server
=
param
elif
opt
in
(
"-p"
,
"--port"
):
port
=
int
(
param
)
elif
opt
in
(
"-v"
,
"--version"
):
...
...
@@ -94,17 +98,20 @@ if command == None:
sys
.
exit
(
1
)
# Our tmcd server is also our DNS server, so that's how we find it.
resolv_conf
=
open
(
"/etc/resolv.conf"
,
"r"
)
for
line
in
resolv_conf
.
readlines
():
if
not
server
:
resolv_conf
=
open
(
"/etc/resolv.conf"
,
"r"
)
for
line
in
resolv_conf
.
readlines
():
match
=
re
.
search
(
r
"nameserver\s+([0-9.]+)"
,
line
)
if
match
:
server
=
match
.
group
(
1
)
break
else
:
else
:
print
>>
sys
.
stderr
,
sys
.
argv
[
0
]
+
": unable to find server address"
sys
.
exit
(
1
)
resolv_conf
.
close
()
resolv_conf
.
close
()
# This is a no-op if 'server' is an IP address.
server
=
socket
.
gethostbyname
(
server
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
sock
.
connect
(
(
server
,
port
)
)
...
...
defs-kwebb-emulab
View file @
33da8a98
...
...
@@ -14,7 +14,8 @@ TBTESTSUITEEMAIL=kwebb@flux.utah.edu
WWW=www.emulab.net/dev/kwebb
THISHOMEBASE=Kwebb.Emulab.Net
ELVIN_COMPAT=0
PROTOGENI_SUPPORT=0
WINDOWS_KEY_7PRO_X86=FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
WINSUPPORT=1
PORTAL_ENABLE=1
PORTAL_ISPRIMARY=1
#PROTOGENI_SUPPORT=0
#WINSUPPORT=1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment