当前位置: 首页>>代码示例>>Python>>正文


Python Shell.which方法代码示例

本文整理汇总了Python中cloudmesh_base.Shell.Shell.which方法的典型用法代码示例。如果您正苦于以下问题:Python Shell.which方法的具体用法?Python Shell.which怎么用?Python Shell.which使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cloudmesh_base.Shell.Shell的用法示例。


在下文中一共展示了Shell.which方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import which [as 别名]
    def start(self):
        try:

            mongod = Shell.which("mongod")
            command = [
                mongod,
                "--dbpath", str(self.db_path),
                "--port", str(self.port),
                "--fork",
                "--logpath", str(self.log_file),
                "--bind_ip", "127.0.0.1"
            ]
            print(" ".join(command))
            #a = subprocess.call(command)
            os.system(" ".join(command))
            os.system ("ps aux | fgrep mongod |fgrep -v fgrep")
            Console.ok("MongoDB has been deployed")
            self.info()

        except Exception, e:
            Console.error("we had a problem starting the  mongo daemon")
            print(e)
            Console.error("MongoDB has stopped")
            # TODO remove the exit in final code, for debugging only
            sys.exit()
开发者ID:kwtillma,项目名称:pbs,代码行数:27,代码来源:cm_jobdb.py

示例2: start

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import which [as 别名]
    def start(self):
        """
        starts the database service

        :return: the pid
        """
        if self.isup():
            _pid = self.pid()
            Console.error("A mongod process on port {:} is already running with pid {:}".format(self.port, _pid))
            return
        else:
            Console.ok("STARTING")

        try:

            mongod = Shell.which("mongod")
            command = [
                mongod,
                "--dbpath", str(self.db_path),
                "--port", str(self.port),
                "--fork",
                "--logpath", str(self.log_file),
                "--bind_ip", "127.0.0.1"
            ]
            print(" ".join(command))
            # a = subprocess.call(command)
            os.system(" ".join(command))
            self.ps()
            Console.ok("MongoDB has been deployed")
            self.info()
            return None  # implement the return of the pid for the process.
            # store the pid in self.pid

        except Exception, e:
            Console.error("we had a problem starting the  mongo daemon")
            print(e)
            Console.error("MongoDB has stopped")
            # TODO remove the exit in final code, for debugging only
            sys.exit()
开发者ID:rajpushkar83,项目名称:pbs,代码行数:41,代码来源:cm_jobdb.py


注:本文中的cloudmesh_base.Shell.Shell.which方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。