本文整理汇总了Python中DIRAC.Interfaces.API.DiracAdmin.DiracAdmin.allowSite方法的典型用法代码示例。如果您正苦于以下问题:Python DiracAdmin.allowSite方法的具体用法?Python DiracAdmin.allowSite怎么用?Python DiracAdmin.allowSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Interfaces.API.DiracAdmin.DiracAdmin
的用法示例。
在下文中一共展示了DiracAdmin.allowSite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DIRACExit
# 需要导入模块: from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin [as 别名]
# 或者: from DIRAC.Interfaces.API.DiracAdmin.DiracAdmin import allowSite [as 别名]
exitCode = 0
errorList = []
setup = gConfig.getValue( '/DIRAC/Setup', '' )
if not setup:
print 'ERROR: Could not contact Configuration Service'
exitCode = 2
DIRACExit( exitCode )
#result = promptUser( 'All the elements that are associated with this site will be active, are you sure about this action?' )
#if not result['OK'] or result['Value'] is 'n':
# print 'Script stopped'
# DIRACExit( 0 )
site = args[0]
comment = args[1]
result = diracAdmin.allowSite( 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
DIRACExit( 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'