Improve MAAS images-import processes
* Add check,that rackd finished bss sync
Unfortunatly, those check for now,possible only for all nodes
* Add a workaround for adding bss.
Maas doesn't have a possibility to check the stream-info import status.
On slow systems\network, boot-source may be added, but information from
it may not be imported yet.
A 400 error raises when trying to configure bss for such boot source
endpoint.
* TODO: maas formula requires refactor.
Current implementation doent care about service separation, aka
Region|rack controller|proxy|dhcpd deployments on different nodes and
related management. Like example - not possible to chose /different/
rack controller to process.
Closes-Bug: PROD-20858 (PROD:20858)
Change-Id: I8875cdb30e7db735db210412c4357da95fe8e320
diff --git a/_states/maasng.py b/_states/maasng.py
index 1cc69f7..99d2fde 100644
--- a/_states/maasng.py
+++ b/_states/maasng.py
@@ -399,10 +399,12 @@
def boot_sources_selections_present(bs_url, os, release, arches="*",
subarches="*", labels="*", wait=True):
"""
- Process maas boot-sources selection: set of resource configurathions, to be downloaded from boot-source bs_url.
+ Process maas boot-sources selection: set of resource configurathions,
+ to be downloaded from boot-source bs_url.
:param bs_url: Boot-source url
- :param os: The OS (e.g. ubuntu, centos) for which to import resources.Required.
+ :param os: The OS (e.g. ubuntu, centos) for which to import
+ resources.Required.
:param release: The release for which to import resources. Required.
:param arches: The architecture list for which to import resources.
:param subarches: The subarchitecture list for which to import resources.
@@ -424,15 +426,16 @@
if bs_url not in maas_boot_sources.keys():
ret["result"] = False
ret[
- "comment"] = 'Requested boot-source {0} not exist! Unable to proceed selection for it'.format(
+ "comment"] = 'Requested boot-source {0} not exist! Unable' \
+ 'to proceed selection for it'.format(
bs_url)
return ret
- ret["changes"] = __salt__['maasng.create_boot_source_selections'](bs_url,
- os,
- release,
- arches=arches,
- subarches=subarches,
- labels=labels,
- wait=wait)
+ ret = __salt__['maasng.create_boot_source_selections'](bs_url,
+ os,
+ release,
+ arches=arches,
+ subarches=subarches,
+ labels=labels,
+ wait=wait)
return ret