コード例 #1
0
    def test_create_aggregate_with_az(self):
        availability_zone = 'az1'
        az_aggregate = fakes.make_fake_aggregate(
            1, self.aggregate_name, availability_zone=availability_zone)

        create_aggregate = az_aggregate.copy()
        del create_aggregate['metadata']
        del create_aggregate['hosts']

        self.register_uris([
            dict(method='POST',
                 uri=self.get_mock_url('compute',
                                       'public',
                                       append=['os-aggregates']),
                 json={'aggregate': create_aggregate},
                 validate=dict(
                     json={
                         'aggregate': {
                             'name': self.aggregate_name,
                             'availability_zone': availability_zone,
                         }
                     })),
        ])

        self.cloud.create_aggregate(name=self.aggregate_name,
                                    availability_zone=availability_zone)

        self.assert_calls()
コード例 #2
0
    def test_create_aggregate_with_az(self):
        availability_zone = 'az1'
        az_aggregate = fakes.make_fake_aggregate(
            1, self.aggregate_name, availability_zone=availability_zone)

        create_aggregate = az_aggregate.copy()
        del create_aggregate['metadata']
        del create_aggregate['hosts']

        self.register_uris([
            dict(method='POST',
                 uri=self.get_mock_url(
                     'compute', 'public', append=['os-aggregates']),
                 json={'aggregate': create_aggregate},
                 validate=dict(json={
                     'aggregate': {
                         'name': self.aggregate_name,
                         'availability_zone': availability_zone,
                     }})),
        ])

        self.cloud.create_aggregate(
            name=self.aggregate_name, availability_zone=availability_zone)

        self.assert_calls()
コード例 #3
0
 def setUp(self):
     super(TestAggregate, self).setUp()
     self.aggregate_name = self.getUniqueString('aggregate')
     self.fake_aggregate = fakes.make_fake_aggregate(1, self.aggregate_name)
     self.use_compute_discovery()
コード例 #4
0
 def setUp(self):
     super(TestAggregate, self).setUp()
     self.aggregate_name = self.getUniqueString('aggregate')
     self.fake_aggregate = fakes.make_fake_aggregate(1, self.aggregate_name)