def do_admin(args): if args.subcommand == 'genesis': do_genesis(args) elif args.subcommand == 'keygen': do_keygen(args) else: raise AssertionError("invalid command: {}".format(args.subcommand))
def do_admin(args): data_dir = ensure_directory('data', '/var/lib/sawtooth') if args.admin_cmd == 'genesis': do_genesis(args, data_dir) elif args.admin_cmd == 'keygen': do_keygen(args) else: raise AssertionError("invalid command: {}".format(args.admin_cmd))
def test_writes_valid_key(self): """Remove existing test files before creating new keys. """ self.remove_key_files() args = self._parse_keygen_command(self._key_name) keygen.do_keygen(args) private_key = _read_signing_keys(self._priv_filename) self.assertIsNotNone(private_key)
def test_writes_valid_key(self): """Remove existing test files before creating new keys. """ self.remove_key_files() args = self._parse_keygen_command(self._key_name) keygen.do_keygen(args) private_key = _read_signing_keys(self._priv_filename) self.assertIsNotNone(private_key)
def test_force_write(self): """Write key files to be overwritten by test of --force option. """ self.remove_key_files() args = self._parse_keygen_command(self._key_name) keygen.do_keygen(args) args = self._parse_keygen_command('--force', self._key_name) keygen.do_keygen(args) private_key = _read_signing_keys(self._priv_filename) self.assertIsNotNone(private_key)
def test_force_write(self): """Write key files to be overwritten by test of --force option. """ self.remove_key_files() args = self._parse_keygen_command(self._key_name) keygen.do_keygen(args) args = self._parse_keygen_command('--force', self._key_name) keygen.do_keygen(args) private_key = _read_signing_keys(self._priv_filename) self.assertIsNotNone(private_key)
def main(prog_name=os.path.basename(sys.argv[0]), args=None, with_loggers=True): parser = create_parser(prog_name) if args is None: args = sys.argv[1:] args = parser.parse_args(args) if with_loggers is True: if args.verbose is None: verbose_level = 0 else: verbose_level = args.verbose setup_loggers(verbose_level=verbose_level) if args.subcommand == 'genesis': do_genesis(args) elif args.subcommand == 'keygen': do_keygen(args) else: raise CliException('Invalid command: {}'.format(args.subcommand))
def main(prog_name=os.path.basename(sys.argv[0]), args=None, with_loggers=True): parser = create_parser(prog_name) if args is None: args = sys.argv[1:] args = parser.parse_args(args) if with_loggers is True: if args.verbose is None: verbose_level = 0 else: verbose_level = args.verbose setup_loggers(verbose_level=verbose_level) if args.subcommand == 'genesis': do_genesis(args) elif args.subcommand == 'keygen': do_keygen(args) else: raise CliException('Invalid command: {}'.format(args.subcommand))