コード例 #1
0
ファイル: yaml.py プロジェクト: krystaknight/drydock
    def process_bootaction_nodefilter(self, nf):
        """Process a dictionary representing a BootAction NodeFilter Set.

        :param nf: dictionary representing the bootaction nodefilter set.
        """
        model = objects.NodeFilterSet()
        model.filter_set_type = nf.get('filter_set_type', None)
        model.filter_set = []

        for nf in nf.get('filter_set', []):
            nf_model = objects.NodeFilter(**nf)
            model.filter_set.append(nf_model)

        return model
コード例 #2
0
    def test_node_filter_obj(self, input_files, setup, deckhand_orchestrator,
                             deckhand_ingester):
        input_file = input_files.join("deckhand_fullsite.yaml")

        design_state = DrydockState()
        design_ref = "file://%s" % str(input_file)

        design_status, design_data = deckhand_ingester.ingest_data(
            design_state=design_state, design_ref=design_ref)

        nf = objects.NodeFilter()
        nf.filter_type = 'intersection'
        nf.node_names = ['compute01']
        nfs = objects.NodeFilterSet(
            filter_set_type='intersection', filter_set=[nf])

        node_list = deckhand_orchestrator.process_node_filter(nfs, design_data)

        assert len(node_list) == 1
コード例 #3
0
    def test_node_filter_obj(self, input_files, setup, test_orchestrator):
        input_file = input_files.join("fullsite.yaml")

        design_state = DrydockState()
        design_ref = "file://%s" % str(input_file)

        ingester = Ingester()
        ingester.enable_plugin(
            'drydock_provisioner.ingester.plugins.yaml.YamlIngester')
        design_status, design_data = ingester.ingest_data(
            design_state=design_state, design_ref=design_ref)

        nf = objects.NodeFilter()
        nf.filter_type = 'intersection'
        nf.node_names = ['compute01']
        nfs = objects.NodeFilterSet(filter_set_type='intersection',
                                    filter_set=[nf])

        node_list = test_orchestrator.process_node_filter(nfs, design_data)

        assert len(node_list) == 1