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


Python Util.printStep方法代码示例

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


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

示例1: _validateParameters

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
 def _validateParameters(self):
     Util.printStep('Validating parameters')
     if not self.registrationLdapScheme:
         raise ValidationException('registration_ldap_scheme is not defined')
     if not self.registrationLdapHost:
         raise ValidationException('registration_ldap_host is not defined')
     if not self.registrationLdapPort:
         raise ValidationException('registration_ldap_port is not defined')
     if not self.registrationLdapManagerDn:
         raise ValidationException('registration_ldap_manager_dn is not defined')
     if not self.registrationLdapManagerPassword:
         raise ValidationException('registration_ldap_manager_password is not defined')
     if not self.registrationAdminEmail:
         raise ValidationException('registration_admin_email is not defined')
     if not self.registrationMailHost:
         raise ValidationException('registration_mail_host is not defined')
     if not self.registrationMailPort:
         raise ValidationException('registration_mail_port is not defined')
     if not self.registrationMailUser:
         raise ValidationException('registration_mail_user is not defined')
     if not self.registrationMailPassword:
         raise ValidationException('registration_mail_password is not defined')
     if not self.registrationMailSsl:
         raise ValidationException('registration_mail_ssl is not defined')
     if not self.registrationMailDebug:
         raise ValidationException('registration_mail_debug is not defined')
     if not self.registrationSslTruststore:
         self.registrationSslTruststore = ''
开发者ID:StratusLab,项目名称:client,代码行数:30,代码来源:Registration.py

示例2: _installPackages

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _installPackages(self):
        Util.printStep('Removing CIMI server package')
        cmd = 'yum erase -y %s' % self._package
        self._executeExitOnError(cmd)

        Util.printStep('Installing CIMI server package')
        cmd = 'yum install --nogpgcheck -y %s' % self._package
        self._executeExitOnError(cmd)
开发者ID:StratusLab,项目名称:client,代码行数:10,代码来源:CIMI.py

示例3: configureDhcpServer

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def configureDhcpServer(self):

        def _dhcpDefined():
            return Util.isTrueConfVal(getattr(self, 'dhcp', 'False'))
        def _dhcpNetTypesDefined():
            return any([Util.isTrueConfVal(getattr(self, self._assembleDhcpAttributeName(v), 'False'))
                                                for v in self.NET_TYPES_DHCP])

        if not _dhcpDefined():
            return
        elif not _dhcpNetTypesDefined():
            return

        Util.printStep('Configuring DHCP service')
        self._installDhcp()
        self._confgureDhcp()
        self._startDhcp()
开发者ID:remyd1,项目名称:client,代码行数:19,代码来源:BaseSystem.py

示例4: _setupFrontend

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _setupFrontend(self):
        self._cleanConfiguration()
        self._checkConfiguration()

        Util.printStep('configure firewall')
        self._configureFirewall()

        Util.printStep('configure sudo')
        self._configureSudo()

        Util.printStep('configure cloud')
        self._configureCloud()
开发者ID:StratusLab,项目名称:client,代码行数:14,代码来源:PortTranslation.py

示例5: _restartService

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
 def _restartService(self):
     Util.printStep('Adding %s to chkconfig and restarting' % self._serviceName)
     cmd = 'chkconfig --add %s' % self._serviceName
     Util.execute(cmd.split(' '))
     cmd = 'service %s restart' % self._serviceName
     Util.execute(cmd.split(' '))
开发者ID:StratusLab,项目名称:client,代码行数:8,代码来源:CouchbaseServer.py

示例6: _installPackagesOnNode

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _installPackagesOnNode(self):
        Util.printStep('Setting up Couchbase yum repository on node')
        cmd = 'curl --output %s %s' % (self._repofile, self._repourl)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep('Removing Couchbase python client')
        try:
            cmd = 'pip uninstall -y couchbase'
            rc, output = self.system._nodeShell(cmd.split(' '),
                                      withOutput=True,
				      shell=True)	
            if rc != 0:
                Util.printInfo('Couchbase python client NOT removed')
            else:
                Util.printInfo('Couchbase python client removed')
        except:
            Util.printInfo("Couchbase python client NOT removed")

        Util.printStep('Removing Couchbase C client')
        cmd = 'yum erase -y %s' % ' '.join(self._pkgs)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep('Installing Couchbase C client')
        cmd = 'yum install -y %s' % ' '.join(self._pkgs)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep('Installing Couchbase python client dependencies')
        cmd = 'yum install --nogpgcheck -y %s' % ' '.join(self._deps)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep('Installing Couchbase python client')
        cmd = 'pip install couchbase'
        self._executeOnNodeExitOnError(cmd)
开发者ID:StratusLab,项目名称:client,代码行数:35,代码来源:CouchbaseClient.py

示例7: _installPackages

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _installPackages(self):
        Util.printStep('Setting up Couchbase yum repository')
        cmd = 'curl --output %s %s' % (self._repofile, self._repourl)
        self._executeExitOnError(cmd)

        Util.printStep('Removing Couchbase python client')
        try:
            cmd = 'pip uninstall -y couchbase'
            rc, output = Util.execute(cmd.split(' '),
                                      withOutput=True,
                                      verboseLevel=self.verboseLevel,
                                      verboseThreshold=Util.VERBOSE_LEVEL_DETAILED)
            if rc != 0:
                Util.printInfo('Couchbase python client NOT removed')
            else:
                Util.printInfo('Couchbase python client removed')
        except:
            Util.printInfo("Couchbase python client NOT removed")

        Util.printStep('Removing Couchbase C client')
        cmd = 'yum erase -y %s' % ' '.join(self._pkgs)
        self._executeExitOnError(cmd)

        Util.printStep('Installing Couchbase C client')
        cmd = 'yum install -y %s' % ' '.join(self._pkgs)
        self._executeExitOnError(cmd)

        Util.printStep('Installing Couchbase python client dependencies')
        cmd = 'yum install -y %s' % ' '.join(self._deps)
        self._executeExitOnError(cmd)

        Util.printStep('Upgrading pip for Couchbase python client')
        cmd = 'pip install --upgrade pip'
        self._executeExitOnError(cmd)

        Util.printStep('Installing Couchbase python client')
        cmd = 'pip install couchbase'
        self._executeExitOnError(cmd)
开发者ID:StratusLab,项目名称:client,代码行数:40,代码来源:CouchbaseClient.py

示例8: _restartService

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
 def _restartService(self, service):
     Util.printStep("Adding registration service to chkconfig and restarting")
     cmd = 'chkconfig --add %s' % service
     Util.execute(cmd.split(' '))
     cmd = 'service %s restart' % service
     Util.execute(cmd.split(' '))
开发者ID:StratusLab,项目名称:client,代码行数:8,代码来源:Registration.py

示例9: _installPackages

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _installPackages(self):
        Util.printStep("Setting up Couchbase yum repository")
        cmd = "curl --output %s %s" % (self._repofile, self._repourl)
        self._executeExitOnError(cmd)

        Util.printStep("Removing Couchbase python client")
        try:
            cmd = "pip uninstall -y couchbase"
            rc, output = Util.execute(
                cmd.split(" "),
                withOutput=True,
                verboseLevel=self.verboseLevel,
                verboseThreshold=Util.VERBOSE_LEVEL_DETAILED,
            )
            if rc != 0:
                Util.printInfo("Couchbase python client NOT removed")
            else:
                Util.printInfo("Couchbase python client removed")
        except:
            Util.printInfo("Couchbase python client NOT removed")

        Util.printStep("Removing Couchbase C client")
        cmd = "yum erase -y %s" % " ".join(self._pkgs)
        self._executeExitOnError(cmd)

        Util.printStep("Installing Couchbase C client")
        cmd = "yum install -y %s" % " ".join(self._pkgs)
        self._executeExitOnError(cmd)

        Util.printStep("Installing Couchbase python client dependencies")
        cmd = "yum install -y %s" % " ".join(self._deps)
        self._executeExitOnError(cmd)

        Util.printStep("Installing Couchbase python client")
        cmd = "pip install couchbase"
        self._executeExitOnError(cmd)
开发者ID:remyd1,项目名称:client,代码行数:38,代码来源:CouchbaseClient.py

示例10: _configure

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _configure(self):
        Util.printStep('(Re-)starting Couchbase')
        cmd = 'service %s restart' % self._serviceName
        self._executeExitOnError(cmd)

        time.sleep(5)

        Util.printStep('Set Couchbase data location')
        options = ['--node-init-data-path=/opt/couchbase/var/lib/couchbase/data']
        cmd = CouchbaseServer._cb_cmd('node-init', self.frontendIp, options)
        self._executeExitOnError(cmd)

        Util.printStep('Create default Couchbase bucket')
        options = ['--bucket=default',
                   '--bucket-type=couchbase',
                   '--bucket-ramsize=400',
                   '--bucket-replica=1']
        cmd = CouchbaseServer._cb_cmd('bucket-create', self.frontendIp, options)
        self._executeExitOnError(cmd)

        Util.printStep('Initialize Couchbase admin account')
        options = ['--cluster-init-username=%s' % self._cb_cluster_username,
                   '--cluster-init-password=%s' % self._cb_cluster_password]
        cmd = CouchbaseServer._cb_cmd('cluster-init', self.frontendIp, options)
        self._executeExitOnError(cmd)

        Util.printStep('Saving cluster password in %s' % self._cb_cluster_password_path)
        with open(self._cb_cluster_password_path, 'w') as f:
            f.write(self._cb_cluster_password + "\n")

        Util.printStep('Reducing read access to password file')
        os.chmod(self._cb_cluster_password_path, 0400)
开发者ID:StratusLab,项目名称:client,代码行数:34,代码来源:CouchbaseServer.py

示例11: _installCAs

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
 def _installCAs(self):
     Util.printStep('Installing CAs and VOMS configuration')
     self.system.installCAs()
开发者ID:StratusLab,项目名称:client,代码行数:5,代码来源:CIMI.py

示例12: _configure

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _configure(self):
        Util.printStep('Configuring OpenLDAP server')

        Util.printStep('Updating sysconfig')
        shutil.copyfile(self._sysconfigLdapTemplate, self._sysconfigLdap)
        Util.appendOrReplaceInFile(self._sysconfigLdap, 'SLAPD_LDAP=', 'SLAPD_LDAP=yes')

        Util.printStep('Setting root account access')
        Util.appendOrReplaceMultilineBlockInFile(self._openLdapConfig, 
                                                 self._accessValue, 
                                                 start='olcAccess: {0}to *', 
                                                 until='olcAddContentAcl:')

        Util.printStep('(Re-)starting slapd')
        cmd = 'service %s restart' % self._serviceName
        self._executeExitOnError(cmd)

        Util.printStep('Generating test certificate and moving into place')
        self._executeExitOnError(self._testCertCmd)

        self._executeExitOnError('mkdir -p /etc/openldap/cacerts')
        self._executeExitOnError('mv -f cacrt.jks /etc/openldap/cacerts/cacrt.jks')
        self._executeExitOnError('mv -f cacrt.pem /etc/openldap/cacerts/cacrt.pem')
        self._executeExitOnError('mv -f serverkey.pem /etc/openldap/serverkey.pem')
        self._executeExitOnError('mv -f servercrt.pem /etc/openldap/servercrt.pem')

        os.chmod('/etc/openldap/serverkey.pem', stat.S_IRUSR | stat.S_IWUSR)
        self._executeExitOnError('chown ldap:ldap /etc/openldap/serverkey.pem')

        Util.printStep('Updating server config. for generated certs')
        cmd = "ldapmodify -Y EXTERNAL -H ldapi:/// -f %s" % self._certConfigLdif
        Util.execute(cmd.split(' '))

        Util.printStep('Updating client config. for generated certs')
        Util.appendOrReplaceInFile(self._ldapClientConfig,
                                   'TLS_CACERT', 
                                   'TLS_CACERT /etc/openldap/cacerts/cacrt.pem')

        Util.printStep('Creating o=cloud database')
        Util.filePutContent(self._completeDatabaseTemplate,
                            Util.fileGetContent(self._databaseTemplate) % self.__dict__)

        cmd = "ldapadd -Y EXTERNAL -H ldapi:/// -f %s" % self._completeDatabaseTemplate
        Util.execute(cmd.split(' '))

        Util.printStep('Adding cloud database entries')
        cmd = "ldapadd -x -H ldaps://%s -D %s -w %s -f %s" % (self._nodename,
                                                              self._openLdapAdminDn, 
                                                              self.openldapPassword, 
                                                              self._cloudDatabaseSkeleton)
        self._executeExitOnError(cmd)
开发者ID:StratusLab,项目名称:client,代码行数:53,代码来源:OpenLDAP.py

示例13: _startServicesFrontend

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
 def _startServicesFrontend(self):
     Util.printStep('restart cloud system')
     self.system.startCloudSystem()
开发者ID:StratusLab,项目名称:client,代码行数:5,代码来源:PortTranslation.py

示例14: _installPackagesOnNode

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
    def _installPackagesOnNode(self):
        Util.printStep("Setting up Couchbase yum repository on node")
        cmd = "curl --output %s %s" % (self._repofile, self._repourl)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep("Removing Couchbase python client")
        try:
            cmd = "pip uninstall -y couchbase"
            rc, output = self.system._nodeShell(cmd.split(" "), withOutput=True, shell=True)
            if rc != 0:
                Util.printInfo("Couchbase python client NOT removed")
            else:
                Util.printInfo("Couchbase python client removed")
        except:
            Util.printInfo("Couchbase python client NOT removed")

        Util.printStep("Removing Couchbase C client")
        cmd = "yum erase -y %s" % " ".join(self._pkgs)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep("Installing Couchbase C client")
        cmd = "yum install -y %s" % " ".join(self._pkgs)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep("Installing Couchbase python client dependencies")
        cmd = "yum install --nogpgcheck -y %s" % " ".join(self._deps)
        self._executeOnNodeExitOnError(cmd)

        Util.printStep("Installing Couchbase python client")
        cmd = "pip install couchbase"
        self._executeOnNodeExitOnError(cmd)
开发者ID:remyd1,项目名称:client,代码行数:33,代码来源:CouchbaseClient.py

示例15: _setupFrontend

# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import printStep [as 别名]
 def _setupFrontend(self):
     if os.path.exists(self._cb_cluster_password_path):
         Util.printStep('%s exists; skipping Couchbase configuration' % self._cb_cluster_password_path)
     else:
         self._configure()
开发者ID:StratusLab,项目名称:client,代码行数:7,代码来源:CouchbaseServer.py


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