Ejemplo n.º 1
0
#!/usr/bin/env python

import sys
sys.path.append("..")
from afs.util.AfsConfig import setupDefaultConfig

from afs.service.VolService import VolService
import afs

setupDefaultConfig()
afs.defaultConfig.CELL_NAME="ipp-garching.mpg.de"
volMng = VolService()
VolName="root.cell"
VolG=volMng.getVolGroup(VolName)
print "Volume Group: %s " %VolG

for v in VolG.RO :
    vol=volMng.getVolume(v["id"],v["serv"],v["part"])
    print "RO-Volume id=%s, server=%s,paritions=%s: %s " % (v["id"],v["serv"],v["part"], vol)

Ejemplo n.º 2
0
from afs.lla.VolumeLLA import VolumeLLA
from afs.lla.VLDbLLA import VLDbLLA
from afs.lla.FileSystemLLA import FileSystemLLA


myParser = argparse.ArgumentParser(
    parents=[afs.argParser], description="nuke a volume. Remove RW and all ROs", add_help=False
)
myParser.add_argument("--volname", dest="VolumeName", required=True, help="Name of Volume")

parseDefaultConfig(myParser)
VD = VolumeLLA()
VS = VolService()

try:
    VolGroup = VS.getVolGroup(afs.defaultConfig.VolumeName)
except:
    print "Cannot get Volume group for %s. Are you sure it exists?" % afs.defaultConfig.VolumeName
    sys.exit(2)


print "Removing volume %s on following sites:" % afs.defaultConfig.VolumeName
print afs.defaultConfig.VolumeName, VolGroup["RW"][0].servername, VolGroup["RW"][0].part


for v in VolGroup["RO"]:
    print v.servername, v.part

sure = raw_input("Are you sure: [y/N] ?")

if not sure in ["y", "Y"]: