Example #1
0
def _validate_feed(config):
    """
    Validates the location of the puppet modules.
    """
    # The feed is optional
    if constants.CONFIG_FEED not in config.keys():
        return True, None

    # Ask the downloader factory to validate the feed has a supported downloader
    feed = config.get(constants.CONFIG_FEED)
    is_valid = downloader_factory.is_valid_feed(feed)
    if not is_valid:
        return False, _('The feed <%(feed_name)s> is invalid') % {'feed_name': feed}

    return True, None
Example #2
0
def _validate_feed(config):
    """
    Validates the location of the puppet modules.
    """

    # The feed is optional
    if constants.CONFIG_FEED not in config.keys():
        return True, None

    # Ask the downloader factory to validate the feed has a supported downloader
    feed = config.get(constants.CONFIG_FEED)
    is_valid = downloader_factory.is_valid_feed(feed)
    if not is_valid:
        return False, _('The feed <%(f)s> is invalid') % {'f': feed}

    return True, None
Example #3
0
 def test_is_valid_feed_false(self):
     self.assertFalse(factory.is_valid_feed(None))
Example #4
0
 def test_is_valid_feed(self):
     self.assertTrue(factory.is_valid_feed('file://localhost'))
Example #5
0
 def test_is_valid_feed_false(self):
     self.assertFalse(factory.is_valid_feed(None))
Example #6
0
 def test_is_valid_feed(self):
     self.assertTrue(factory.is_valid_feed('file://localhost'))