diff options
Diffstat (limited to 'rpkid/rpki/rpkic.py')
-rw-r--r-- | rpkid/rpki/rpkic.py | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/rpkid/rpki/rpkic.py b/rpkid/rpki/rpkic.py index 79c2e556..7b7f6cfb 100644 --- a/rpkid/rpki/rpkic.py +++ b/rpkid/rpki/rpkic.py @@ -208,48 +208,46 @@ class main(rpki.cli.Cmd): self.zoo.write_bpki_files() - # These aren't quite ready for prime time yet. See https://trac.rpki.net/ticket/466 - - if False: + def do_create_identity(self, arg): + """ + Create a new resource-holding entity. Argument is the handle of + the entity to create. Returns XML file describing the new + resource holder. - def do_create_identity(self, arg): - """ - Create a new resource-holding entity. Argument is the handle of - the entity to create. Returns XML file describing the new - resource holder. + This command is idempotent: calling it for a resource holder which + already exists returns the existing identity. + """ - This command is idempotent: calling it for a resource holder which - already exists returns the existing identity. - """ + argv = arg.split() + if len(argv) != 1: + raise BadCommandSyntax("This command expexcts one argument, not %r" % arg) - argv = arg.split() - if len(argv) != 1: - raise BadCommandSyntax("This command expexcts one argument, not %r" % arg) + self.zoo.reset_identity(argv[0]) - self.zoo.reset_identity(argv[0]) + rootd_case = self.zoo.run_rootd and self.zoo.handle == self.zoo.cfg.get("handle") - rootd_case = self.zoo.run_rootd and self.zoo.handle == self.zoo.cfg.get("handle") + r = self.zoo.initialize_resource_bpki() + r.save("%s.identity.xml" % self.zoo.handle, + None if rootd_case else sys.stdout) - r = self.zoo.initialize_resource_bpki() - r.save("%s.identity.xml" % self.zoo.handle, - None if rootd_case else sys.stdout) + if rootd_case: + r = self.zoo.configure_rootd() + if r is not None: + r.save("%s.%s.repository-request.xml" % (self.zoo.handle, self.zoo.handle), sys.stdout) + self.zoo.write_bpki_files() - if rootd_case: - r = self.zoo.configure_rootd() - if r is not None: - r.save("%s.%s.repository-request.xml" % (self.zoo.handle, self.zoo.handle), sys.stdout) - def do_initialize_server_bpki(self, arg): - """ - Initialize server BPKI portion of an RPKI installation. Reads - server configuration from configuration file and creates the - server BPKI objects needed to start daemons. - """ + def do_initialize_server_bpki(self, arg): + """ + Initialize server BPKI portion of an RPKI installation. Reads + server configuration from configuration file and creates the + server BPKI objects needed to start daemons. + """ - if arg: - raise BadCommandSyntax, "This command takes no arguments" - self.zoo.initialize_server_bpki() - self.zoo.write_bpki_files() + if arg: + raise BadCommandSyntax, "This command takes no arguments" + self.zoo.initialize_server_bpki() + self.zoo.write_bpki_files() def do_update_bpki(self, arg): |