BindUser = User;
ListMode = 0
FingerPrints = 0
+Host = None
# 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;
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])