Exemplo n.º 1
0
 def setUp(self):
     super(PolicyFixture, self).setUp()
     self.policy_dir = self.useFixture(fixtures.TempDir())
     self.policy_file_name = os.path.join(self.policy_dir.path,
                                          'policy.json')
     with open(self.policy_file_name, 'w') as policy_file:
         policy_file.write(fake_policy.policy_data)
     CONF.set_override('policy_file', self.policy_file_name)
     ironic_policy.reset()
     ironic_policy.init()
     self.addCleanup(ironic_policy.reset)
Exemplo n.º 2
0
 def setUp(self):
     super(PolicyFixture, self).setUp()
     self.policy_dir = self.useFixture(fixtures.TempDir())
     self.policy_file_name = os.path.join(self.policy_dir.path,
                                          'policy.json')
     with open(self.policy_file_name, 'w') as policy_file:
         policy_file.write(fake_policy.policy_data)
     CONF.set_override('policy_file', self.policy_file_name)
     ironic_policy.reset()
     ironic_policy.init()
     self.addCleanup(ironic_policy.reset)
Exemplo n.º 3
0
 def test_policy_file_not_found(self):
     ironic_policy.reset()
     CONF.set_override('policy_file', '/non/existent/policy/file')
     self.assertRaises(exception.ConfigNotFound, ironic_policy.init)
Exemplo n.º 4
0
 def test_policy_file_not_found(self):
     ironic_policy.reset()
     CONF.set_override('policy_file', '/non/existant/policy/file')
     self.assertRaises(exception.ConfigNotFound, ironic_policy.init)