summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/DataSourceMAAS.py (renamed from cloudinit/DataSourceMaaS.py)28
-rw-r--r--cloudinit/__init__.py2
2 files changed, 15 insertions, 15 deletions
diff --git a/cloudinit/DataSourceMaaS.py b/cloudinit/DataSourceMAAS.py
index ea42c1fb..80d3fd6e 100644
--- a/cloudinit/DataSourceMaaS.py
+++ b/cloudinit/DataSourceMAAS.py
@@ -31,9 +31,9 @@ import time
MD_VERSION = "2012-03-01"
-class DataSourceMaaS(DataSource.DataSource):
+class DataSourceMAAS(DataSource.DataSource):
"""
- DataSourceMaaS reads instance information from MaaS.
+ DataSourceMAAS reads instance information from MAAS.
Given a config metadata_url, and oauth tokens, it expects to find
files under the root named:
instance-id
@@ -44,7 +44,7 @@ class DataSourceMaaS(DataSource.DataSource):
baseurl = None
def __str__(self):
- return("DataSourceMaaS[%s]" % self.baseurl)
+ return("DataSourceMAAS[%s]" % self.baseurl)
def get_data(self):
mcfg = self.ds_cfg
@@ -55,9 +55,9 @@ class DataSourceMaaS(DataSource.DataSource):
self.metadata = metadata
self.baseurl = self.seeddir
return True
- except MaasSeedDirNone:
+ except MAASSeedDirNone:
pass
- except MaasSeedDirMalformed as exc:
+ except MAASSeedDirMalformed as exc:
log.warn("%s was malformed: %s\n" % (self.seeddir, exc))
raise
@@ -143,7 +143,7 @@ def read_maas_seed_dir(seed_d):
md = {}
if not os.path.isdir(seed_d):
- raise MaasSeedDirNone("%s: not a directory")
+ raise MAASSeedDirNone("%s: not a directory")
for fname in files:
try:
@@ -195,17 +195,17 @@ def check_seed_contents(content, seed):
"""Validate if content is Is the content a dict that is valid as a
return for a datasource.
Either return a (userdata, metadata) tuple or
- Raise MaasSeedDirMalformed or MaasSeedDirNone
+ Raise MAASSeedDirMalformed or MAASSeedDirNone
"""
md_required = ('instance-id', 'local-hostname')
found = content.keys()
if len(content) == 0:
- raise MaasSeedDirNone("%s: no data files found" % seed)
+ raise MAASSeedDirNone("%s: no data files found" % seed)
missing = [k for k in md_required if k not in found]
if len(missing):
- raise MaasSeedDirMalformed("%s: missing files %s" % (seed, missing))
+ raise MAASSeedDirMalformed("%s: missing files %s" % (seed, missing))
userdata = content.get('user-data', "")
md = {}
@@ -233,16 +233,16 @@ def oauth_headers(url, consumer_key, token_key, token_secret, consumer_secret):
return(req.to_header())
-class MaasSeedDirNone(Exception):
+class MAASSeedDirNone(Exception):
pass
-class MaasSeedDirMalformed(Exception):
+class MAASSeedDirMalformed(Exception):
pass
datasources = [
- (DataSourceMaaS, (DataSource.DEP_FILESYSTEM, DataSource.DEP_NETWORK)),
+ (DataSourceMAAS, (DataSource.DEP_FILESYSTEM, DataSource.DEP_NETWORK)),
]
@@ -261,7 +261,7 @@ if __name__ == "__main__":
import argparse
import pprint
- parser = argparse.ArgumentParser(description='Interact with Maas DS')
+ parser = argparse.ArgumentParser(description='Interact with MAAS DS')
parser.add_argument("--config", metavar="file",
help="specify DS config file", default=None)
parser.add_argument("--ckey", metavar="key",
@@ -292,7 +292,7 @@ if __name__ == "__main__":
with open(args.config) as fp:
cfg = yaml.load(fp)
if 'datasource' in cfg:
- cfg = cfg['datasource']['MaaS']
+ cfg = cfg['datasource']['MAAS']
for key in creds.keys():
if key in cfg and creds[key] == None:
creds[key] = cfg[key]
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
index 3168a632..6d276d84 100644
--- a/cloudinit/__init__.py
+++ b/cloudinit/__init__.py
@@ -29,7 +29,7 @@ cfg_env_name = "CLOUD_CFG"
cfg_builtin = """
log_cfgs: []
-datasource_list: ["NoCloud", "ConfigDrive", "OVF", "MaaS", "Ec2", "CloudStack"]
+datasource_list: ["NoCloud", "ConfigDrive", "OVF", "MAAS", "Ec2", "CloudStack"]
def_log_file: /var/log/cloud-init.log
syslog_fix_perms: syslog:adm
"""