本文整理汇总了Python中cloudmesh_base.Shell.Shell.sh方法的典型用法代码示例。如果您正苦于以下问题:Python Shell.sh方法的具体用法?Python Shell.sh怎么用?Python Shell.sh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudmesh_base.Shell.Shell
的用法示例。
在下文中一共展示了Shell.sh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import sh [as 别名]
def execute(self, name, command):
"""executes the command on the named host"""
if name in ["localhost"]:
r = '\n'.join(Shell.sh("-c", command).split()[-1:])
else:
r = '\n'.join(Shell.ssh(name, command).split()[-1:])
return r
示例2: start
# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import sh [as 别名]
def start(self):
"""
Starts the cloudmesh_job process in the background.
"""
for key in ['dbpath', 'logpath']:
path = os.dirname(self.config[key])
Shell.mkdir(path)
r = Shell.sh("mongod", "--fork",
"--logpath", self.config['logpath'],
"--prot", self.config['port'],
'--dbpath', self.config['dbpath'])
print (r)
# TODO
# get the id from r
self.config['id'] = None # put here the real id