Beispiel #1
0
 def _siteassociations(self, assoctype):
     """Init and return associations[assoctype]."""
     assocs = setattr_if_none(self, 'siteassociations', {})
     return assocs.setdefault(assoctype,
                              AssociationsMap(assoctype, 'sites'))
Beispiel #2
0
 def _associations(self, assoctype):
     """Init and return associations[assoctype]."""
     assocs = setattr_if_none(self, 'associations', {})
     return assocs.setdefault(assoctype,
                              AssociationsMap(assoctype, **_NODESMAPKWARGS))
Beispiel #3
0
 def _firmwareassociations(self):
     """Init and return firmwareassociations."""
     return setattr_if_none(self, 'firmwareassociations',
                            AssociationsMap('firmware', **_NODESMAPKWARGS))
Beispiel #4
0
 def _profileassociations(self):
     """Init and return profileassociations."""
     return setattr_if_none(self, 'profileassociations',
                            AssociationsMap('profile', **_NODESMAPKWARGS))
Beispiel #5
0
def _add_siteassoc_to_dict(assocs, sites, assoctype, assocname):
    """Add given site association to 'assocs' dict."""
    name = site_association_name(assoctype, assocname)
    assoc = assocs.setdefault(assoctype, AssociationsMap(assoctype, 'sites'))
    assoc.extendvalues(name, sites)