當前位置: 首頁>>代碼示例>>Python>>正文


Python certdirectory.Path類代碼示例

本文整理匯總了Python中subscription_manager.certdirectory.Path的典型用法代碼示例。如果您正苦於以下問題:Python Path類的具體用法?Python Path怎麽用?Python Path使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Path類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 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()
開發者ID:belonesox,項目名稱:subscription-manager,代碼行數:14,代碼來源:repolib.py

示例2: __init__

 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()
開發者ID:Januson,項目名稱:subscription-manager,代碼行數:16,代碼來源:repofile.py

示例3: __init__

 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()
開發者ID:cgwalters,項目名稱:subscription-manager,代碼行數:16,代碼來源:repolib.py

示例4: installed

 def installed(cls):
     return os.path.exists(Path.abs(cls.PATH))
開發者ID:Januson,項目名稱:subscription-manager,代碼行數:2,代碼來源:repofile.py

示例5: test_normal_pathjoin

 def test_normal_pathjoin(self):
     ed = EntitlementDirectory()
     self.assertEquals('/etc/pki/entitlement/1-key.pem',
             Path.join(ed.productpath(), "1-key.pem"))
開發者ID:jkonecny12,項目名稱:subscription-manager,代碼行數:4,代碼來源:test_certdirectory.py

示例6: test_sysimage_pathjoin

 def test_sysimage_pathjoin(self):
     Path.ROOT = '/mnt/sysimage'
     ed = EntitlementDirectory()
     self.assertEquals('/mnt/sysimage/etc/pki/entitlement/1-key.pem',
             Path.join(ed.productpath(), '1-key.pem'))
開發者ID:jkonecny12,項目名稱:subscription-manager,代碼行數:5,代碼來源:test_certdirectory.py

示例7: test_modified_root_no_trailing_slash

 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/'))
開發者ID:jkonecny12,項目名稱:subscription-manager,代碼行數:6,代碼來源:test_certdirectory.py

示例8: test_modified_root

 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/'))
開發者ID:jkonecny12,項目名稱:subscription-manager,代碼行數:6,代碼來源:test_certdirectory.py

示例9: test_normal_root

 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/'))
開發者ID:jkonecny12,項目名稱:subscription-manager,代碼行數:5,代碼來源:test_certdirectory.py

示例10: certpath

 def certpath():
     return str(Path.join(ConsumerIdentity.PATH, ConsumerIdentity.CERT))
開發者ID:Januson,項目名稱:subscription-manager,代碼行數:2,代碼來源:identity.py

示例11: keypath

 def keypath():
     return str(Path.join(ConsumerIdentity.PATH, ConsumerIdentity.KEY))
開發者ID:Januson,項目名稱:subscription-manager,代碼行數:2,代碼來源:identity.py

示例12: __mkdir

 def __mkdir(self):
     path = Path.abs(self.PATH)
     if not os.path.exists(path):
         os.mkdir(path)
開發者ID:Januson,項目名稱:subscription-manager,代碼行數:4,代碼來源:identity.py

示例13: certpath

 def certpath(cls):
     return Path.join(cls.PATH, cls.CERT)
開發者ID:aweiteka,項目名稱:subscription-manager,代碼行數:2,代碼來源:identity.py

示例14: keypath

 def keypath(cls):
     return Path.join(cls.PATH, cls.KEY)
開發者ID:aweiteka,項目名稱:subscription-manager,代碼行數:2,代碼來源:identity.py


注:本文中的subscription_manager.certdirectory.Path類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。