def test_option_was_set(self): key_size_option = "rsa_key_size" key_size_value = cli.flag_default(key_size_option) self.parse("--rsa-key-size {0}".format(key_size_value).split()) self.assertTrue(cli.option_was_set(key_size_option, key_size_value)) self.assertTrue(cli.option_was_set("no_verify_ssl", True)) config_dir_option = "config_dir" self.assertFalse(cli.option_was_set(config_dir_option, cli.flag_default(config_dir_option)))
def test_option_was_set(self): key_size_option = 'rsa_key_size' key_size_value = cli.flag_default(key_size_option) self.parse('--rsa-key-size {0}'.format(key_size_value).split()) self.assertTrue(cli.option_was_set(key_size_option, key_size_value)) self.assertTrue(cli.option_was_set('no_verify_ssl', True)) config_dir_option = 'config_dir' self.assertFalse(cli.option_was_set( config_dir_option, cli.flag_default(config_dir_option)))
def test_option_was_set(self): key_size_option = 'rsa_key_size' key_size_value = cli.flag_default(key_size_option) self.parse('--rsa-key-size {0}'.format(key_size_value).split()) self.assertTrue(cli.option_was_set(key_size_option, key_size_value)) self.assertTrue(cli.option_was_set('no_verify_ssl', True)) config_dir_option = 'config_dir' self.assertFalse( cli.option_was_set(config_dir_option, cli.flag_default(config_dir_option))) self.assertFalse( cli.option_was_set('authenticator', cli.flag_default('authenticator')))
def relevant_values(all_values): """Return a new dict containing only items relevant for renewal. :param dict all_values: The original values. :returns: A new dictionary containing items that can be used in renewal. :rtype dict: """ return dict((option, value) for option, value in six.iteritems(all_values) if _relevant(option) and cli.option_was_set(option, value))
def relevant_values(all_values): """Return a new dict containing only items relevant for renewal. :param dict all_values: The original values. :returns: A new dictionary containing items that can be used in renewal. :rtype dict: """ return dict( (option, value) for option, value in six.iteritems(all_values) if _relevant(option) and cli.option_was_set(option, value))
def relevant_values(all_values): """Return a new dict containing only items relevant for renewal. :param dict all_values: The original values. :returns: A new dictionary containing items that can be used in renewal. :rtype dict: """ rv = dict((option, value) for option, value in six.iteritems(all_values) if _relevant(option) and cli.option_was_set(option, value)) # We always save the server value to help with forward compatibility # and behavioral consistency when versions of Certbot with different # server defaults are used. rv["server"] = all_values["server"] return rv
def relevant_values(all_values): """Return a new dict containing only items relevant for renewal. :param dict all_values: The original values. :returns: A new dictionary containing items that can be used in renewal. :rtype dict: """ plugins = plugins_disco.PluginsRegistry.find_all() namespaces = [plugins_common.dest_namespace(plugin) for plugin in plugins] rv = dict( (option, value) for option, value in six.iteritems(all_values) if _relevant(namespaces, option) and cli.option_was_set(option, value)) # We always save the server value to help with forward compatibility # and behavioral consistency when versions of Certbot with different # server defaults are used. rv["server"] = all_values["server"] return rv