Changeset 855 for vanHelsing/trunk/src/VanHelsingWrapper.py
- Timestamp:
- Mar 26, 2010, 6:42:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/src/VanHelsingWrapper.py
r839 r855 13 13 password="" 14 14 for a in xrange(0,len): 15 password += random.choice(charset)15 password += random.choice(charset) 16 16 return password 17 17 … … 86 86 def getResourceById(directorName,resId): 87 87 dirdcfg=getDirectorConfig(directorName) 88 return dirdcfg.getRoot().getById(resId) 88 return dirdcfg.getRoot().getById(resId) 89 90 def setResourceById(resId, directorName, attributes, resInfo): 91 if resId > 0: 92 myResource = getResourceById(directorName, resId) 93 myResource.items = [] 94 for a in attributes: 95 k = a.get_element_key() 96 v = a.get_element_value() 97 myResource.add(k, v) 98 99 else: 100 resource = resource.Resource() 101 resource.name = resInfo.get_element_resName() 102 setResourceById(resource.getId, directorName, attributes, resInfo) 103 104 status = "wtf" 105 106 return resId, status 89 107 90 108 def getResourceByName(directorName,resType,name): … … 103 121 clientIds=getResources("bacula-dir","Client") 104 122 105 c=getResourceById("bacula-dir",clientIds[0][0]) 106 print c 107 print keyValueList(c) 108 123 #c=getResourceById("bacula-dir",clientIds[0][0]) 124 #print c 125 #print keyValueList(c) 126 attList = [("name", "klaus"), ("director", "bernd"), ("FileSet","homeAll")] 127 resId, status = setResourceById(100, "bacula-dir", attList)
Note:
See TracChangeset
for help on using the changeset viewer.