Skip to content
Snippets Groups Projects
Commit e35d63f1 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Fixed bug #95576: "entertapepool" doesn't check vmgr

parent 918d5f0d
Branches
Tags
No related merge requests found
......@@ -124,7 +124,7 @@ try:
stcur.execute('SELECT * FROM MigrationRouting WHERE fileclass=:fcid', fcid=fileClassId)
rows = stcur.fetchall()
if len(rows) > 0:
print 'Migration route(s) already exist for FileClass %s. Please remove them first' % fileclassname
print 'Migration route(s) already exist for FileClass %s. Please remove first' % fileclassname
print 'Giving up'
sys.exit(1)
# check validity of copyNbs and tapePoolNames
......
......@@ -125,13 +125,22 @@ try:
# connect to stager
stconn = castor_tools.connectToStager()
stcur = stconn.cursor()
# check that the tape pool does exist
# check that the tape pool does not exist in the stager
stcur.execute('SELECT id FROM TapePool WHERE name=:name', name=tapePoolName)
rows = stcur.fetchall()
if len(rows) != 0:
print 'TapePool %s already exists in the stager DB' % tapePoolName
print 'You may want to use modifytapepool'
sys.exit(1)
# check that the tapepool exists in the vmgr
stconnvmgr = castor_tools.connectToVmgr()
stcurvmgr = stconnvmgr.cursor()
stcurvmgr.execute('SELECT * FROM VMGR_TAPE_POOL WHERE name=:name', name=tapePoolName)
rows = stcurvmgr.fetchall()
if len(rows) == 0:
print 'Tape pool %s does not exist in VMGR' % tapePoolName
print 'Giving up'
sys.exit(1)
# get info on user running this command
lasteditor = pwd.getpwuid(os.getuid())[0]
# insert new tapepool
......
......@@ -79,6 +79,14 @@ inserted tape pool testtapepool successfully
newtapepool 0 100GiB 1000 12h 7 sponcec3 30-Aug-2011 16:32:15
testtapepool 2 23MiB 1000 12h23mn 8 sopncec3 30-Aug-2011 16:42:32
# entertapepool testtapepool
TapePool testtapepool already exists in the stager DB
You may want to use modifytapepool
# entertapepool nonexistingtapepool
Tape pool nonexistingtapepool does not exist in VMGR
Giving up
.SH NOTES
This command requires database client access to the stager catalog and nameserver DBs.
Configuration for the database accesses is taken from castor.conf.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment