projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update maintainer/initial uploaders field
[mirror/userdir-ldap.git]
/
ud-host
diff --git
a/ud-host
b/ud-host
index
956c046
..
442de6d
100755
(executable)
--- a/
ud-host
+++ b/
ud-host
@@
-129,7
+129,7
@@
def Overview(Attrs):
# Change a single attribute
def ChangeAttr(Attrs,Attr):
# Change a single attribute
def ChangeAttr(Attrs,Attr):
- if (Attr == "sponsor" or Attr == "
hostname" or Attr == "
sshRSAHostKey"):
+ if (Attr == "sponsor" or Attr == "sshRSAHostKey"):
return MultiChangeAttr(Attrs,Attr);
print "Old value: '%s'" % (GetAttr(Attrs,Attr,""));
return MultiChangeAttr(Attrs,Attr);
print "Old value: '%s'" % (GetAttr(Attrs,Attr,""));
@@
-213,8
+213,14
@@
User = pwd.getpwuid(os.getuid())[0];
BindUser = User;
ListMode = 0
FingerPrints = 0
BindUser = User;
ListMode = 0
FingerPrints = 0
+Host = None
# Process options
# Process options
-(options, arguments) = getopt.getopt(sys.argv[1:], "nh:a:rlf")
+try:
+ (options, arguments) = getopt.getopt(sys.argv[1:], "nh:a:rlf")
+except getopt.GetoptError, data:
+ print data
+ sys.exit(1)
+
for (switch, val) in options:
if (switch == '-h'):
Host = val;
for (switch, val) in options:
if (switch == '-h'):
Host = val;
@@
-254,7
+260,10
@@
if ListMode == 1:
Overview(hAttrs)
sys.exit(0)
elif FingerPrints == 1:
Overview(hAttrs)
sys.exit(0)
elif FingerPrints == 1:
- Attrs = l.search_s(HBaseDn,ldap.SCOPE_ONELEVEL,"host=*")
+ if Host is not None:
+ Attrs = l.search_s(HBaseDn,ldap.SCOPE_ONELEVEL,"host=" + Host)
+ else:
+ Attrs = l.search_s(HBaseDn,ldap.SCOPE_ONELEVEL,"host=*")
hosts = []
for hAttrs in Attrs:
hosts.append(hAttrs[1]['host'][0])
hosts = []
for hAttrs in Attrs:
hosts.append(hAttrs[1]['host'][0])