Example #1
0
 def create_project(self, name, description, owner="", rw_locations=[], ro_locations=[]) :
     """
     create an empty project
     """
     this_project = Project()
     this_project.name = name
     this_project.description = description
     this_project.owner = owner
     this_project.rw_locations = rw_locations
     this_project.ro_locations = ro_locations
     # store_project adds db_id
     return self.store_project(this_project)
Example #2
0
Commands.add_argument('--updateVolumeMappings', action='store_true')
Commands.add_argument('--showServerSpread', action='store_true')
Commands.add_argument('--updateServerSpread', action='store_true')
Commands.add_argument('--showStorageUsage', action='store_true')

parseDefaultConfig(myParser)

CS=CellService()
VS=OSDVolService()
FsS=OSDFsService()
PS=ProjectService()
DBM=DBManager()

CellInfo=CS.getCellInfo(cached=True)
CellInfo.FileServers=CellInfo.FileServers
PrjObj = Project()
defaultDict=PrjObj.getDict()

#
#
# dump/import :
# for serverpartitions, tranlsate for dump into human readable.
# also dump raw server-uuids. 
# for import only consider human readable
# but fail if we find no UUID for the hostname
if afs.defaultConfig.dumpPrj == True :
    for p in PS.getProjectList() :
        if afs.defaultConfig.prjname != "" and p.name != afs.defaultConfig.prjname : continue
        d=p.getDict()
        if afs.defaultConfig.prjname != ""  and afs.defaultConfig.prjname !=  d["name"] : continue 
        print "========================================"