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


Python Trust.set_args方法代码示例

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


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

示例1: test_trust_gpg_email_id

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def test_trust_gpg_email_id(self):
     args = self.Args()
     testobj = Trust(policy_filename=os.path.join(FIXTURE_DIR, "show_policy.json"))
     testobj.atomic_config = util.get_atomic_config(atomic_config=os.path.join(FIXTURE_DIR, "atomic.conf"))
     testobj.set_args(args)
     actual = testobj.get_gpg_id(args.pubkeys)
     self.assertEqual("[email protected]", actual)
开发者ID:jwhonce,项目名称:atomic,代码行数:9,代码来源:test_trust.py

示例2: TrustDelete

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def TrustDelete(self, registry, sigstoretype):
     trust = Trust()
     args = self.Args()
     args.sigstoretype = sigstoretype
     args.registry = registry
     trust.set_args(args)
     trust.delete()
开发者ID:jwhonce,项目名称:atomic,代码行数:9,代码来源:atomic_dbus.py

示例3: test_setup_default_policy

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def test_setup_default_policy(self):
     args = self.Args()
     args.sigstoretype = "web"
     testobj = Trust()
     testobj.set_args(args)
     with open(os.path.join(FIXTURE_DIR, "default_policy.json"), "r") as default:
         policy_default = json.load(default)
     policy_default = testobj.check_policy(policy_default, "docker")
     policy_expected = {"default": [{"type": "insecureAcceptAnything"}], "transports": {"docker": {}}}
     self.assertEqual(policy_default, policy_expected)
开发者ID:jwhonce,项目名称:atomic,代码行数:12,代码来源:test_trust.py

示例4: TrustAdd

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def TrustAdd(self, registry, trusttype, pubkeys, keytype, sigstore, sigstoretype):
     trust = Trust()
     args = self.Args()
     args.registry = registry
     args.pubkeys = pubkeys
     args.keytype = keytype
     args.trust_type = trusttype
     args.sigstoretype = sigstoretype
     args.sigstore = sigstore
     trust.set_args(args)
     trust.add()
开发者ID:jwhonce,项目名称:atomic,代码行数:13,代码来源:atomic_dbus.py

示例5: test_trust_show

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def test_trust_show(self):
     args = self.Args()
     testobj = Trust(policy_filename=os.path.join(FIXTURE_DIR, "show_policy.json"))
     testobj.atomic_config = util.get_atomic_config(atomic_config=os.path.join(FIXTURE_DIR, "atomic.conf"))
     testobj.set_args(args)
     with self.captured_output() as (out, _):
         testobj.show()
     with open(os.path.join(FIXTURE_DIR, "show_policy.output"), "r") as f:
         expected = f.read()
         actual = out.getvalue()
         self.assertEqual(expected, actual)
开发者ID:jwhonce,项目名称:atomic,代码行数:13,代码来源:test_trust.py

示例6: test_add_trust_keys

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def test_add_trust_keys(self):
     args = self.Args()
     args.sigstore = None
     testobj = Trust(policy_filename = TEST_POLICY)
     testobj.atomic_config = util.get_atomic_config(atomic_config = os.path.join(FIXTURE_DIR, "atomic.conf"))
     testobj.set_args(args)
     testobj.add()
     with open(testobj.policy_filename, 'r') as f:
         d = json.load(f)
         self.assertEqual(d["transports"]["atomic"]["docker.io"][0]["keyPath"], 
                          os.path.join(FIXTURE_DIR, "key1.pub"))
开发者ID:shishir-a412ed,项目名称:atomic,代码行数:13,代码来源:test_trust.py

示例7: test_delete_trust

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def test_delete_trust(self):
     args = self.Args()
     args.pubkeys = []
     args.sigstoretype = "web"
     args.registry = "registry.example.com/foo"
     args.pubkeys = None
     testobj = Trust(policy_filename=TEST_POLICY)
     testobj.atomic_config = util.get_atomic_config(atomic_config=os.path.join(FIXTURE_DIR, "atomic.conf"))
     testobj.set_args(args)
     testobj.delete()
     with open(testobj.policy_filename, "r") as f:
         d = json.load(f)
         self.assertNotIn(args.registry, d["transports"]["docker"])
开发者ID:jwhonce,项目名称:atomic,代码行数:15,代码来源:test_trust.py

示例8: test_add_reject_type

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def test_add_reject_type(self):
     args = self.Args()
     args.trust_type = "reject"
     args.sigstoretype = "web"
     args.pubkeys = []
     args.registry = "registry.example.com/foo"
     testobj = Trust(policy_filename=TEST_POLICY)
     testobj.atomic_config = util.get_atomic_config(atomic_config=os.path.join(FIXTURE_DIR, "atomic.conf"))
     testobj.set_args(args)
     testobj.add()
     with open(testobj.policy_filename, "r") as f:
         d = json.load(f)
         self.assertEqual(d["transports"]["docker"][args.registry][0]["type"], args.trust_type)
开发者ID:jwhonce,项目名称:atomic,代码行数:15,代码来源:test_trust.py

示例9: pull_image

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
    def pull_image(self, image, pull_args):
        # Add this when atomic registry is incorporated.
        # if self.args.reg_type == "atomic":
        #     pull_uri = 'atomic:'
        # else:
        #     pull_uri = 'docker://'
        img_obj = self._make_remote_image(image)
        fq_name = img_obj.fq_name
        insecure = True if util.is_insecure_registry(self.d.info()['RegistryConfig'], util.strip_port(img_obj.registry)) else False

        # This needs to be re-enabled with Aaron's help
        trust = Trust()
        trust.set_args(pull_args)
        trust.discover_sigstore(fq_name)

        util.write_out("Pulling {} ...".format(fq_name))
        util.skopeo_copy("docker://{}".format(fq_name),
                         "docker-daemon:{}".format(image),
                         debug=pull_args.debug, insecure=insecure,
                         policy_filename=pull_args.policy_filename)
开发者ID:baude,项目名称:atomic,代码行数:22,代码来源:_docker.py

示例10: TrustDefaultPolicy

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def TrustDefaultPolicy(self, default_policy):
     trust = Trust()
     args = self.Args()
     args.default_policy = default_policy
     trust.set_args(args)
     return trust.modify_default()
开发者ID:jwhonce,项目名称:atomic,代码行数:8,代码来源:atomic_dbus.py

示例11: TrustShow

# 需要导入模块: from Atomic.trust import Trust [as 别名]
# 或者: from Atomic.trust.Trust import set_args [as 别名]
 def TrustShow(self):
     trust = Trust()
     args = self.Args()
     trust.set_args(args)
     return json.dumps(trust.show_json())
开发者ID:jwhonce,项目名称:atomic,代码行数:7,代码来源:atomic_dbus.py


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