Revision de2461ec

b/snf-cyclades-app/synnefo/tools/burnin.py
678 678
        cls.serverid = server['id']
679 679

  
680 680
        #Insist on connecting until action timeout
681
        connected = (self.client.get_network_details(self.networkid))
682 681
        fail_tmout = time.time()+self.action_timeout
683 682

  
684 683
        while True:
684
            connected = (self.client.get_network_details(self.networkid))
685 685
            connections = connected['servers']['values']
686 686
            if (self.serverid in connections):
687 687
                conn_exists = True
688
            if time.time() > fail_tmout:
688
                break
689
            elif time.time() > fail_tmout:
689 690
                self.assertLess(time.time(), fail_tmout)
690 691
            else:
691 692
                time.sleep(self.query_interval)
......
701 702
        time.sleep(15)
702 703

  
703 704
        #Insist on deleting until action timeout
704
        connected = (self.client.get_network_details(self.networkid))
705 705
        fail_tmout = time.time()+self.action_timeout
706 706

  
707 707
        while True:
708
            connected = (self.client.get_network_details(self.networkid))
708 709
            connections = connected['servers']['values']
709 710
            if (self.serverid not in connections):
710 711
                conn_exists = False
711
            if time.time() > fail_tmout:
712
                break
713
            elif time.time() > fail_tmout:
712 714
                self.assertLess(time.time(), fail_tmout)
713 715
            else:
714 716
                time.sleep(self.query_interval)
......
722 724

  
723 725
        curr_net = []
724 726
        for net in networks:
725
            curr_net.appent(net['id'])
727
            curr_net.append(net['id'])
726 728

  
727 729
        self.assertTrue(self.networkid not in curr_net)
728 730
        
729 731
    def test_005_cleanup_servers(self):
730 732
        """Cleanup servers created for this test"""
731
        self.compute.delete_server(self.server_id)
733
        self.compute.delete_server(self.serverid)
732 734
        fail_tmout = time.time()+self.action_timeout
733 735

  
734 736
        #Ensure server gets deleted
735 737
        while True:
736
            status = self.compute.get_server_details(self.serverid)
738
            details = self.compute.get_server_details(self.serverid)
739
            status = details['status']
737 740
            if status == 'DELETED':
738 741
                deleted = True
742
                break
739 743
            elif time.time() > fail_tmout: 
740 744
                self.assertLess(time.time(), fail_tmout)
741 745
            else:

Also available in: Unified diff