summaryrefslogtreecommitdiffstats
path: root/ansible/install_dependencies.yml
blob: 001418497e29126aa1002da0afb27dfd91ba7116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) 2017 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: install yardstick dependencies
  hosts: all

  roles:
    - install_dependencies
39;: str(fabrics[subnet.get('fabric', + self._get_fabric_from_cidr(subnet.get('cidr')))]), 'cidr': subnet.get('cidr'), 'gateway_ip': subnet['gateway_ip'], } @@ -215,6 +216,13 @@ self._process_iprange(res_json['id']) return response + def _get_fabric_from_cidr(self, cidr): + subnets = json.loads(self._maas.get(u'api/2.0/subnets/').read()) + for subnet in subnets: + if subnet['cidr'] == cidr: + return subnet['vlan']['fabric'] + return '' + def _process_iprange(self, subnet_id): ipranges = json.loads(self._maas.get(u'api/2.0/ipranges/').read()) LOG.warn('all %s ipranges %s', subnet_id, ipranges)