← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:maas-improve-ds-main into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:maas-improve-ds-main into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/306226
-- 
Your team cloud init development team is requested to review the proposed merge of ~smoser/cloud-init:maas-improve-ds-main into cloud-init:master.
diff --git a/cloudinit/sources/DataSourceMAAS.py b/cloudinit/sources/DataSourceMAAS.py
index ab93c0a..81abcd4 100644
--- a/cloudinit/sources/DataSourceMAAS.py
+++ b/cloudinit/sources/DataSourceMAAS.py
@@ -310,12 +310,12 @@ if __name__ == "__main__":
         creds = {'consumer_key': args.ckey, 'token_key': args.tkey,
                  'token_secret': args.tsec, 'consumer_secret': args.csec}
 
-        maaspkg_cfg = "/etc/cloud/cloud.cfg.d/90_dpkg_maas.cfg"
-        if (args.config is None and args.url is None and
-                os.path.exists(maaspkg_cfg) and
-                os.access(maaspkg_cfg, os.R_OK)):
-            sys.stderr.write("Used config in %s.\n" % maaspkg_cfg)
-            args.config = maaspkg_cfg
+        if args.config is None:
+            for fname in ('91_kernel_cmdline_url', '90_dpkg_maas'):
+                fpath = "/etc/cloud/cloud.cfg.d/" + fname + ".cfg"
+                if os.path.exists(fpath) and os.access(fpath, os.R_OK):
+                    sys.stderr.write("Used config in %s.\n" % fpath)
+                    args.config = fpath
 
         if args.config:
             cfg = util.read_conf(args.config)

Follow ups