Load the instackenv.json file and wait till the ironic nodes are ready.
        TODO(Gonéri): should be splitted, write_instackenv() to generate the
        instackenv.json and instackenv_import() for the rest.

def load_instackenv(self):
        """Load the instackenv.json file and wait till the ironic nodes are ready.
        TODO(Gonéri): should be splitted, write_instackenv() to generate the
        instackenv.json and instackenv_import() for the rest.
        """
        self.add_environment_file(user='stack', filename='stackrc')
        self.run('openstack baremetal import --json instackenv.json', user='stack')
        ironic_node_nbr = 0
        count_cmd = 'jq -M "{filter}|length" /home/stack/instackenv.json'
        # Nodes are either in the .nodes list or at the root of the document
        for f in ['.nodes', '.']:
            try:
                ironic_node_nbr = int(
                    self.run(count_cmd.format(filter=f), user='stack')[0])
            except ValueError:
                pass
            if ironic_node_nbr > 0:
                break
        self._wait_for_ironic_nodes(ironic_node_nbr)
        # register association with the newly created ironic nodes and the
        # existing barematal nodes in the factory
        self.baremetal_factory.set_ironic_uuid(self.list_nodes())
        self.run('openstack baremetal configure boot', user='stack')