Esempio n. 1
0
    def create_client(self, *args, **kwargs):
        """Helper to create a new hiera client.

        By default, patches _validate function so a non-existent config file
        may be used.

        :param patch_validate: bool optional switch to enable _validate patch
        :rtype: :class:`hiera.HieraClient`
        """
        patch_validate = kwargs.pop('patch_validate', True)
        if patch_validate:
            with mock.patch.object(hiera.HieraClient, '_validate'):
                return hiera.HieraClient(*args, **kwargs)
        else:
            return hiera.HieraClient(*args, **kwargs)
Esempio n. 2
0
def main():
    hiera_client = hiera.HieraClient(
        '/etc/puppet/modules/ucsm-puppet/hiera.yaml', environment='dev')
    loginInstance = ucs_login()
    handle = loginInstance.ucs_login(hiera_client)
    ucs_handle = pickle.dumps(handle)
    #print(type(ucs_handle))
    return ucs_handle
Esempio n. 3
0
def main():
    hiera_client = hiera.HieraClient('/etc/puppet/modules/ucsm-puppet/hiera.yaml',environment='dev')
    results = boot_policy(hiera_client)
    print(results)
    return results