salt-formulas / reclass

A recursive external node classifier for automation tools like Ansible, Puppet, and Salt
Other
53 stars 23 forks source link

Update mixed and yaml_git for compose_node_name changes #67

Closed AndrewPickford closed 6 years ago

AndrewPickford commented 6 years ago

This patch fixes method signatures in the mixed and yaml_git storage types to match the changes in yaml_fs with the addition of the compose_node_name option.

The base class of ExternalNodeStorage classes is changed from NodeStorageBase to ExternalNodeStorageBase (which has as it's base class NodeStorageBase). This allows the MemcacheProxy class to retain NodeStorageBase as it's base class and have the compose_node_name option name mangler selection moved into the ExternalNodeStorageBase class.

The selected name mangler functions are then available to any storage classes as: self.class_name_mangler and self.node_name_mangler

Tested on my reclass configuration for the three storage types with compose_node_name=False. For compose_node_name=True mixed and yaml_fs storage types should be fine as the changes are small, but it would be nice to double check with a reclass config that uses compose_node_name=True.

For yaml_git storage using compose_node_name=True is an untested and not supported option for this patch. It should work fine, but unless someone needs to this it's very low priority which I don't want to have block the critical method signature fixes.

epcim commented 6 years ago

@gburiola can you test this patch on your setup with compose_node_name=True?