本文整理汇总了Python中common.Common.set_repo方法的典型用法代码示例。如果您正苦于以下问题:Python Common.set_repo方法的具体用法?Python Common.set_repo怎么用?Python Common.set_repo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.Common
的用法示例。
在下文中一共展示了Common.set_repo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Provision
# 需要导入模块: from common import Common [as 别名]
# 或者: from common.Common import set_repo [as 别名]
class Provision(object):
def __init__(self, repolist):
self.repolist = repolist
self.yum = YumUtils()
self.shell = ShellUtils()
self.com = Common()
def provision(self):
# run instack
self.com.set_user('stack', 'stack')
self.com.set_repo(['http://trunk.rdoproject.org/centos7/delorean-deps.repo',])
self._install_pkg(['epel-release', 'instack-undercloud'])
self._deploy_instack()
return self._get_instack_ip()
def is_instack(self):
if self._get_instack_ip() != '':
return True
def _install_pkg(self, pkgs):
for pkg in pkgs:
self.yum.yum_install(pkg)
def _deploy_instack(self):
return self.shell._exec_shell_cmd('su stack instack-virt-setup')
def _get_instack_ip(self):
return self.shell._exec_shell_cmd("arp -n | grep virbr0 | awk '{print $1}'")
示例2: Undercloud
# 需要导入模块: from common import Common [as 别名]
# 或者: from common.Common import set_repo [as 别名]
class Undercloud(object):
repo_path = "/etc/yum.repos.d/"
def __init__(self, repolist):
self.repolist = repolist
self.yum = YumUtils()
self.shell = ShellUtils()
self.com = Common()
def undercloud(self):
self._install_pkg(['epel-release', 'yum-plugin-priorities', 'python-tripleoclient',])
self.com.set_repo(['http://trunk.rdoproject.org/centos7/delorean-deps.repo',])
def _install_pkg(self, pkgs):
for pkg in pkgs:
self.yum.yum_install(pkg)
def _deploy_undercloud(self):
return self.shell._exec_cmd('openstack undercloud install')