Esempio n. 1
0
def valid_action_name(value, config_context):
    valid_identifier(value, config_context)
    if value == CLEANUP_ACTION_NAME:
        error_msg = "Invalid action name %s at %s"
        raise ConfigError(error_msg % (value, config_context.path))
    return value
Esempio n. 2
0
def valid_node_name(value, config_context):
    valid_identifier(value, config_context)
    if not config_context.partial and value not in config_context.nodes:
        msg = "Unknown node name %s at %s"
        raise ConfigError(msg % (value, config_context.path))
    return value
Esempio n. 3
0
 def test_valid_identifier(self):
     name = 'avalidname'
     assert_equal(name, valid_identifier(name, mock.Mock()))
Esempio n. 4
0
 def test_valid_identifier(self):
     name = 'avalidname'
     assert_equal(name, valid_identifier(name, mock.Mock()))
Esempio n. 5
0
def valid_action_name(value, config_context):
    valid_identifier(value, config_context)
    if value == CLEANUP_ACTION_NAME:
        error_msg = "Invalid action name %s at %s"
        raise ConfigError(error_msg % (value, config_context.path))
    return value
Esempio n. 6
0
def valid_node_name(value, config_context):
    valid_identifier(value, config_context)
    if not config_context.partial and value not in config_context.nodes:
        msg = "Unknown node name %s at %s"
        raise ConfigError(msg % (value, config_context.path))
    return value