from suricata.update import config
from suricata.update import sources
from suricata.update import util
-from suricata.update.commands.updatesources import update_sources
from suricata.update import exceptions
logger = logging.getLogger()
free_only = config.args().free
if not sources.source_index_exists(config):
- logger.info("No source index found, running update-sources")
- try:
- update_sources()
- except exceptions.ApplicationError as err:
- logger.warning("%s: will use bundled index.", err)
+ logger.warning("Source index does not exist, will use bundled one.")
+ logger.warning("Please run suricata-update update-sources.")
+
index = sources.load_source_index(config)
for name, source in index.get_sources().items():
is_not_free = source.get("subscribe-url")
# the index.
delete(os.path.join(DATA_DIR, "update", "cache", "index.yaml"))
run(common_args + ["list-sources"])
-assert (os.path.exists(os.path.join(DATA_DIR, "update", "cache",
- "index.yaml")))
+assert(not os.path.exists(os.path.join(DATA_DIR, "update", "cache", "index.yaml")))
# Enable a source.
run(common_args + ["enable-source", "oisf/trafficid"])