Revision 2005b18e kamaki/clients/tests/cyclades.py

b/kamaki/clients/tests/cyclades.py
142 142
            for net in nics:
143 143
                found_nic = net['network_id'] == netid
144 144
                if (in_creation and found_nic) or not (
145
                    in_creation or found_nic):
146
                        return
145
                        in_creation or found_nic):
146
                    return
147 147
            time.sleep(wait)
148 148
        self.do_with_progress_bar(
149 149
            nicwait,
......
152 152
                servid,
153 153
                '' if in_creation else 'dis'),
154 154
            self._waits[:5])
155
        return netid in [net['network_id']\
156
            for net in self.client.list_server_nics(servid)]
155
        for net in self.client.list_server_nics(servid):
156
            if netid == net['network_id']:
157
                return True
158
        return False
157 159

  
158 160
    def _has_status(self, servid, status):
159 161
        r = self.client.get_server_details(servid)
......
254 256
        self.assertEqual(len(dservers), len(servers))
255 257
        for i in range(len(servers)):
256 258
            for field in (
257
                'created',
258
                'flavorRef',
259
                'hostId',
260
                'imageRef',
261
                'progress',
262
                'status',
263
                'updated'):
259
                    'created',
260
                    'flavorRef',
261
                    'hostId',
262
                    'imageRef',
263
                    'progress',
264
                    'status',
265
                    'updated'):
264 266
                self.assertFalse(field in servers[i])
265 267
                self.assertTrue(field in dservers[i])
266 268

  
......
302 304
    def _test_0050_update_server_name(self):
303 305
        new_name = self.servname1 + '_new_name'
304 306
        self.client.update_server_name(self.server1['id'], new_name)
305
        r = self.client.get_server_details(self.server1['id'],
306
         success=(200, 400))
307
        r = self.client.get_server_details(
308
            self.server1['id'],
309
            success=(200, 400))
307 310
        self.assertEqual(r['name'], new_name)
308 311
        changed = self.servers.pop(self.servname1)
309 312
        changed['name'] = new_name
......
339 342

  
340 343
    def test_create_server_metadata(self):
341 344
        """Test create_server_metadata"""
342
        self.server1 = self._create_server(self.servname1,
345
        self.server1 = self._create_server(
346
            self.servname1,
343 347
            self.flavorid,
344 348
            self.img)
345 349
        self._test_0080_create_server_metadata()

Also available in: Unified diff