本文整理汇总了Python中subscription_manager.certdirectory.Path.abs方法的典型用法代码示例。如果您正苦于以下问题:Python Path.abs方法的具体用法?Python Path.abs怎么用?Python Path.abs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscription_manager.certdirectory.Path
的用法示例。
在下文中一共展示了Path.abs方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def __init__(self, name='redhat.repo'):
ConfigParser.__init__(self)
# note PATH get's expanded with chroot info, etc
self.path = Path.join(self.PATH, name)
self.repos_dir = Path.abs(self.PATH)
self.manage_repos = manage_repos_enabled()
# Simulate manage repos turned off if no yum.repos.d directory exists.
# This indicates yum is not installed so clearly no need for us to
# manage repos.
if not self.path_exists(self.repos_dir):
log.warn("%s does not exist, turning manage_repos off." %
self.repos_dir)
self.manage_repos = False
self.create()
示例2: __init__
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def __init__(self, path=None, name=None):
# note PATH get's expanded with chroot info, etc
path = path or self.PATH
name = name or self.NAME
self.path = Path.join(path, name)
self.repos_dir = Path.abs(path)
self.manage_repos = manage_repos_enabled()
# Simulate manage repos turned off if no repos directory exists.
# This indicates the corresponding package manager is not installed so
# clearly no need for us to manage repos.
if not self.path_exists(self.repos_dir):
log.warn("%s does not exist, turning manage_repos off." %
self.repos_dir)
self.manage_repos = False
else:
self.create()
示例3: __init__
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def __init__(self, name='redhat.repo'):
ConfigParser.__init__(self)
# note PATH get's expanded with chroot info, etc
self.path = Path.join(self.PATH, name)
self.repos_dir = Path.abs(self.PATH)
self.manage_repos = 1
if CFG.has_option('rhsm', 'manage_repos'):
self.manage_repos = int(CFG.get('rhsm', 'manage_repos'))
# Simulate manage repos turned off if no yum.repos.d directory exists.
# This indicates yum is not installed so clearly no need for us to
# manage repos.
if not os.path.exists(self.repos_dir):
log.warn("%s does not exist, turning manage_repos off." %
self.repos_dir)
self.manage_repos = 0
self.create()
示例4: installed
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def installed(cls):
return os.path.exists(Path.abs(cls.PATH))
示例5: test_modified_root_no_trailing_slash
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def test_modified_root_no_trailing_slash(self):
Path.ROOT = '/mnt/sysimage'
self.assertEquals('/mnt/sysimage/etc/pki/consumer/',
Path.abs('/etc/pki/consumer/'))
self.assertEquals('/mnt/sysimage/etc/pki/consumer/',
Path.abs('etc/pki/consumer/'))
示例6: test_modified_root
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def test_modified_root(self):
Path.ROOT = '/mnt/sysimage/'
self.assertEquals('/mnt/sysimage/etc/pki/consumer/',
Path.abs('/etc/pki/consumer/'))
self.assertEquals('/mnt/sysimage/etc/pki/consumer/',
Path.abs('etc/pki/consumer/'))
示例7: test_normal_root
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def test_normal_root(self):
# this is the default, but have to set it as other tests can modify
# it if they run first.
self.assertEquals('/etc/pki/consumer/', Path.abs('/etc/pki/consumer/'))
self.assertEquals('/etc/pki/consumer/', Path.abs('etc/pki/consumer/'))
示例8: __mkdir
# 需要导入模块: from subscription_manager.certdirectory import Path [as 别名]
# 或者: from subscription_manager.certdirectory.Path import abs [as 别名]
def __mkdir(self):
path = Path.abs(self.PATH)
if not os.path.exists(path):
os.mkdir(path)