Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Connect to $DCSERVER if none given in cnl.
[doldaconnect.git]
/
lib
/
python
/
dolcon
/
__init__.py
diff --git
a/lib/python/dolcon/__init__.py
b/lib/python/dolcon/__init__.py
index
e7adb29
..
b969028
100644
(file)
--- a/
lib/python/dolcon/__init__.py
+++ b/
lib/python/dolcon/__init__.py
@@
-1,4
+1,5
@@
from dolmod import *
from dolmod import *
+import os
def login(useauthless = True, **kw):
result = [None]
def login(useauthless = True, **kw):
result = [None]
@@
-19,7
+20,11
@@
def mustconnect(host, port = -1):
if resp.getcode() != 200:
raise RuntimeError, resp.intresp()[0][0]
if resp.getcode() != 200:
raise RuntimeError, resp.intresp()[0][0]
-def cnl(host, port = -1, useauthless = True, **kw):
+def cnl(host = None, port = -1, useauthless = True, **kw):
+ if host is None:
+ host = os.getenv("DCSERVER")
+ if host is None:
+ raise ValueError, "No DC host to connect to"
mustconnect(host, port)
err, reason = login(useauthless, **kw)
if err != "success":
mustconnect(host, port)
err, reason = login(useauthless, **kw)
if err != "success":