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


Python Utils.append_command_to_file方法代码示例

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


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

示例1: create_enable_datasource_command

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import append_command_to_file [as 别名]
 def create_enable_datasource_command(self,
                                      datasource_name):
     """
     Set given data source enabled.
     :param datasource_name: name of data source user want to enable
     :return:
     """
     enable_command = 'data-source enable --name=' + datasource_name
     ctx.logger.info('Enable command: [{0}]'.format(enable_command))
     Utils.append_command_to_file(enable_command, self.command_script)
开发者ID:carriercomm,项目名称:cloudify-jboss-plugin,代码行数:12,代码来源:jbosscli.py

示例2: create_undeploy_command

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import append_command_to_file [as 别名]
 def create_undeploy_command(self,
                             war_name):
     """
     Create undeploy command that is saved to file 'script.cli'
     in temporary folder to get invoked by jboss-cli.sh '--file' parameter
     :param war_name: name of war to be undeployed
     :return:
     """
     undeploy_command = 'undeploy' + ' ' + war_name
     ctx.logger.info('Undeploy command [{0}]'.format(undeploy_command))
     Utils.append_command_to_file(undeploy_command, self.command_script)
开发者ID:carriercomm,项目名称:cloudify-jboss-plugin,代码行数:13,代码来源:jbosscli.py

示例3: create_deploy_command

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import append_command_to_file [as 别名]
 def create_deploy_command(self,
                           resource_dir,
                           resource_name):
     """
     Create deploy command that is saved to file 'script.cli'
     in temporary folder to get invoked by jboss-cli.sh '--file' parameter
     :param resource_name: resource name
     :param resource_dir: resource directory path
     :return:
     """
     deploy_command = 'deploy' + ' ' + resource_dir + '/' + resource_name
     ctx.logger.info('Deploy command [{0}]'.format(deploy_command))
     Utils.append_command_to_file(deploy_command, self.command_script)
开发者ID:carriercomm,项目名称:cloudify-jboss-plugin,代码行数:15,代码来源:jbosscli.py

示例4: run_script

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import append_command_to_file [as 别名]
 def run_script(self):
     """
     Run script
     :return:
     """
     Utils.append_command_to_file('run-batch', self.command_script)
     if (self.user is None) or (self.password is None):
         out = Utils.system(self.cli_path,
                            '--file=' + self.command_script,
                            '--controller=' + self.address)
     else:
         out = Utils.system(self.cli_path,
                            '--file=' + self.command_script,
                            '--controller=' + self.address,
                            '--user=' + self.user,
                            '--password=' + self.password)
     if self.is_there_any_problem(out):
         ctx.logger.error(out)
     else:
         ctx.logger.info(out)
开发者ID:carriercomm,项目名称:cloudify-jboss-plugin,代码行数:22,代码来源:jbosscli.py

示例5: create_xadatasource_command

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import append_command_to_file [as 别名]
 def create_xadatasource_command(self,
                                 datasource_name,
                                 jndi_name,
                                 driver_name,
                                 connection_url):
     """
     Create datasource command that is saved to file 'datasource.cli'
     in temporary folder to get invoked by jboss-cli.sh '--file' parameter
     :param datasource_name: name of data source user wants to give
     :param jndi_name: name of jndi on which datasource will be registered
     :param driver_name: given driver name in installation
     :param connection_url: connection url to database
     :return:
     """
     datasource_command = 'data-source add --name=' + datasource_name + \
                          ' --jndi-name=' + jndi_name + \
                          ' --driver_name=' + driver_name + \
                          ' --connection_url=' + connection_url
     ctx.logger.info('Data source XA command: [{0}]'
                     .format(datasource_command))
     Utils.append_command_to_file(datasource_command, self.command_script)
开发者ID:carriercomm,项目名称:cloudify-jboss-plugin,代码行数:23,代码来源:jbosscli.py

示例6: add_jdbc_driver_command

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import append_command_to_file [as 别名]
 def add_jdbc_driver_command(self,
                             name,
                             org_com,
                             xa_datasource_class_name,
                             driver_class_name):
     """
     Add jdbc driver to standalone.xml configuration. Use jboss-cli.sh
     command to add driver with specific information about module,
     driver class and jdbc-driver name.
     :param name: name of jboss jdbc driver user wants to give
     :param org_com: type of driver {org, com}
     :param xa_datasource_class_name: class name for XA datasource
     :param driver_class_name: driver class name
     :return:
     """
     text = '/subsystem=datasources/jdbc-driver={0}:' \
            'add(driver-name={0}, driver-module-name={1}.{0},' \
            'driver-xa-datasource-class-name={2},' \
            'driver-class-name={3})'\
         .format(name,
                 org_com,
                 xa_datasource_class_name,
                 driver_class_name)
     Utils.append_command_to_file(text, self.command_script)
开发者ID:carriercomm,项目名称:cloudify-jboss-plugin,代码行数:26,代码来源:jbosscli.py


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