本文整理汇总了Python中DIRAC.Interfaces.API.DiracAdmin.DiracAdmin.addSiteInMask方法的典型用法代码示例。如果您正苦于以下问题:Python DiracAdmin.addSiteInMask方法的具体用法?Python DiracAdmin.addSiteInMask怎么用?Python DiracAdmin.addSiteInMask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Interfaces.API.DiracAdmin.DiracAdmin
的用法示例。
在下文中一共展示了DiracAdmin.addSiteInMask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin [as 别名]
# 或者: from DIRAC.Interfaces.API.DiracAdmin.DiracAdmin import addSiteInMask [as 别名]
if len( args ) < 2:
Script.showHelp()
diracAdmin = DiracAdmin()
exitCode = 0
errorList = []
setup = gConfig.getValue( '/DIRAC/Setup', '' )
if not setup:
print 'ERROR: Could not contact Configuration Service'
exitCode = 2
DIRAC.exit( exitCode )
site = args[0]
comment = args[1]
result = diracAdmin.addSiteInMask( site, comment, printOutput = True )
if not result['OK']:
errorList.append( ( site, result['Message'] ) )
exitCode = 2
else:
if email:
userName = diracAdmin._getCurrentUser()
if not userName['OK']:
print 'ERROR: Could not obtain current username from proxy'
exitCode = 2
DIRAC.exit( exitCode )
userName = userName['Value']
subject = '%s is added in site mask for %s setup' % ( site, setup )
body = 'Site %s is added to the site mask for %s setup by %s on %s.\n\n' % ( site, setup, userName, time.asctime() )
body += 'Comment:\n%s' % comment
addressPath = 'EMail/Production'