diff --git a/src/puptoo/process/__init__.py b/src/puptoo/process/__init__.py index 53aa632e..bfe8e2fd 100644 --- a/src/puptoo/process/__init__.py +++ b/src/puptoo/process/__init__.py @@ -32,8 +32,14 @@ def validate_size(path, extra): extra["request_id"] ) # TODO: actively reject payloads that exceed our configured max size - # err_msg = f"Archive exceeds unextracted file limit of {config.MAX_EXTRACTED_SIZE}" - # raise Exception(err_msg) + elif total_size >= int(config.MAX_EXTRACTED_SIZE_L2): + # Request for debugging usage in insights-engine + logger.info( + "Unpacked archive exceeds extracted file size limit of %s (but within limit %s), request_id: %s", + config.MAX_EXTRACTED_SIZE_L2, + config.MAX_EXTRACTED_SIZE, + extra["request_id"] + ) @contextmanager @@ -83,8 +89,9 @@ def extract(msg, extra, remove=True): 'bios_uuid', 'ip_addresses', 'mac_addresses', 'fqdn' ] + def validateCanonicalFacts(facts): if (all(key in facts for key in PROVIDER) - or not any(key in facts for key in PROVIDER)) and any(key in facts for key in FACTS_EXCEPT_PROVIDER): + or not any(key in facts for key in PROVIDER)) and any(key in facts for key in FACTS_EXCEPT_PROVIDER): return True return False diff --git a/src/puptoo/utils/config.py b/src/puptoo/utils/config.py index 3923f137..19e2e5f1 100644 --- a/src/puptoo/utils/config.py +++ b/src/puptoo/utils/config.py @@ -83,6 +83,7 @@ def get_namespace(): FACT_EXTRACT_LOGLEVEL = os.getenv("FACT_EXTRACT_LOGLEVEL", "ERROR") DISABLE_PROMETHEUS = True if os.getenv("DISABLE_PROMETHEUS") == "True" else False MAX_EXTRACTED_SIZE = os.getenv("MAX_EXTRACTED_SIZE", 1000000000) # 1GB Default +MAX_EXTRACTED_SIZE_L2 = os.getenv("MAX_EXTRACTED_SIZE", 536870912) # 512MB Default NAMESPACE = get_namespace() HOSTNAME = os.environ.get("HOSTNAME") BUILD_COMMIT = os.getenv("OPENSHIFT_BUILD_COMMIT", "not_in_openshift")