

def _ironic(self, action, flags='', params=''):
    'Execute ironic command for the given action.\n\n        :param action: the cli command to run using Ironic\n        :type action: string\n        :param flags: any optional cli flags to use\n        :type flags: string\n        :param params: any optional positional args to use\n        :type params: string\n        '
    flags += ' --os-endpoint-type publicURL'
    try:
        if hasattr(self, 'os_auth_token'):
            return self._cmd_no_auth('ironic', action, flags, params)
        else:
            for keystone_object in ('user', 'project'):
                domain_attr = ('os_%s_domain_id' % keystone_object)
                if hasattr(self, domain_attr):
                    flags += (' --os-%(ks_obj)s-domain-id %(value)s' % {
                        'ks_obj': keystone_object,
                        'value': getattr(self, domain_attr),
                    })
            return self.client.cmd_with_auth('ironic', action, flags, params)
    except exceptions.CommandFailed as e:
        self.fail(e)

dataset/ETHPy150Open openstack/python-ironicclient/ironicclient/tests/functional/base.py FunctionalTestBase._ironic/original