From 2ee2d10a042c96160e4745431d1d0c25904b5d88 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 6 Sep 2013 23:54:51 -0700 Subject: Ensure validate checks key existence. --- cloudinit/config/cc_seed_random.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cloudinit/config') diff --git a/cloudinit/config/cc_seed_random.py b/cloudinit/config/cc_seed_random.py index acacb8f7..592d253f 100644 --- a/cloudinit/config/cc_seed_random.py +++ b/cloudinit/config/cc_seed_random.py @@ -63,6 +63,8 @@ def validate(cfg): """Method that can be used to ask if the given configuration will be accepted as valid by this module, without having to actually activate this module.""" + if not cfg or "random_seed" not in cfg: + return try: jsonschema.validate(cfg, schema) except js_exc.ValidationError as e: -- cgit v1.2.3