本文整理汇总了Python中DIRAC.DataManagementSystem.Client.DataManager.DataManager.put方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.put方法的具体用法?Python DataManager.put怎么用?Python DataManager.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.DataManagementSystem.Client.DataManager.DataManager
的用法示例。
在下文中一共展示了DataManager.put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __copyToExternalSE
# 需要导入模块: from DIRAC.DataManagementSystem.Client.DataManager import DataManager [as 别名]
# 或者: from DIRAC.DataManagementSystem.Client.DataManager.DataManager import put [as 别名]
def __copyToExternalSE( self, localFilePath, sbPath ):
"""
Copy uploaded file to external SE
"""
try:
dm = DataManager()
result = dm.put( sbPath, localFilePath, self.__externalSEName )
if not result[ 'OK' ]:
return result
if 'Successful' not in result[ 'Value' ]:
gLogger.verbose( "Oops, no successful transfers there", str( result ) )
return S_ERROR( "RM returned OK to the action but no successful transfers were there" )
okTrans = result[ 'Value' ][ 'Successful' ]
if sbPath not in okTrans:
gLogger.verbose( "Ooops, SB transfer wasn't in the successful ones", str( result ) )
return S_ERROR( "RM returned OK to the action but SB transfer wasn't in the successful ones" )
return S_OK( ( self.__externalSEName, okTrans[ sbPath ] ) )
except Exception, e:
return S_ERROR( "Error while moving sandbox to SE: %s" % str( e ) )