def parseCMDLine(): myParser=argparse.ArgumentParser(parents=[afs.argParser], add_help=False,epilog=afs.argParser.epilog) myParser.add_argument("--setup", default="./Test.cfg", help="path to Testconfig") parseDefaultConfig(myParser) if not os.path.exists(afs.defaultConfig.setup) : sys.stderr.write("Test setup file %s does not exist.\n" %afs.defaultConfig.setup) sys.exit(2) return
from afs.lla.VolumeLLA import VolumeLLA from afs.lla.VLDbLLA import VLDbLLA from afs.lla.FileSystemLLA import FileSystemLLA myParser=argparse.ArgumentParser(parents=[afs.argParser], add_help=False) myParser.add_argument("--volname", dest="VolumeName", required=True, help="Name of Volume") myParser.add_argument("--voltype", dest="VolumeType", default="RW", help="Type of Volume") myParser.add_argument("--size", dest="VolumeSize", default="5000", help="Size of Volume in KB") myParser.add_argument("--mpt", dest="Mountpoint", help="Mountpoint for the new volume.") myParser.add_argument("--mpttype", dest="MountpointType", default="RW", choices=['RW', 'RO'], help="Type of mountpoint: RW or RO. Defaults to RW.") myParser.add_argument("--aclpath", dest="ACLOrigin", help="path in AFS to copy ACLs from.") myParser.add_argument("--prj", dest="ProjectName", help="Name of Project") myParser.add_argument("--force", action='store_true', dest="force", default=False, help="force creation, even if Volume does not fit in given project") parseDefaultConfig(myParser) VD=VolumeLLA() VlD=VLDbLLA() FsD=FileSystemLLA() VolumeType = afs.defaultConfig.VolumeType if afs.defaultConfig.VolumeName[-9:] == ".readonly" : VolumeName = afs.defaultConfig.VolumeName[:-9] VolumeType = "RO" else : VolumeName = afs.defaultConfig.VolumeName VolSize=parseHumanWriteableSize(afs.defaultConfig.VolumeSize)/1024 PS=ProjectService() # we get a list of Projects, sorted by the Nesting Level. # only get the most specific one