Ejemplo n.º 1
0
 def test_on_network_error(self):
     data = {
         "dump": {
             "master": {
                 "objects": [
                     {
                         "path": "/etc/nailgun",
                         "type": "dir"
                     },
                 ],
                 "hosts": [{
                     "ssh-key": "/root/.ssh/id_rsa",
                     "address": "10.109.2.2"
                 }]
             },
         }
     }
     conf = Config(data)
     obj = conf.objects.next()
     host = conf.get_network_address(obj)
     self.assertNotIn(obj, conf.try_again)
     self.assertNotIn(host, conf.offline_hosts)
     conf.on_network_error(obj)
     self.assertIn(obj, conf.try_again)
     self.assertIn(host, conf.offline_hosts)
Ejemplo n.º 2
0
 def test_on_network_error(self):
     data = {
         "dump": {
             "master": {
                 "objects":
                     [{"path": "/etc/nailgun",
                       "type": "dir"},
                      ],
                 "hosts": [{"ssh-key": "/root/.ssh/id_rsa",
                            "address": "10.109.2.2"}]},
         }
     }
     conf = Config(data)
     obj = conf.objects.next()
     host = conf.get_network_address(obj)
     self.assertNotIn(obj, conf.try_again)
     self.assertNotIn(host, conf.offline_hosts)
     conf.on_network_error(obj)
     self.assertIn(obj, conf.try_again)
     self.assertIn(host, conf.offline_hosts)