From ebc26f02c4c1f9d34a7759743a038f35cc59653d Mon Sep 17 00:00:00 2001 From: Hua Wang Date: Wed, 29 Jul 2015 23:35:20 +0800 Subject: [PATCH] Remove redundant code about fake_policy The code is copied from ironic. Ironic has no policy in Juno , so it need the code to test. But it is not needed in magnum. Change-Id: Ib066d953993b92c7c96d661cfcb7f2d3ef888659 Closes-Bug: #1482023 --- magnum/tests/fake_policy.py | 15 --------------- magnum/tests/policy_fixture.py | 4 +--- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/magnum/tests/fake_policy.py b/magnum/tests/fake_policy.py index 172a49c744..8cdd81ac17 100644 --- a/magnum/tests/fake_policy.py +++ b/magnum/tests/fake_policy.py @@ -70,18 +70,3 @@ policy_data = """ "container:update": "" } """ - - -policy_data_compat_juno = """ -{ -} -""" - - -def get_policy_data(compat): - if not compat: - return policy_data - elif compat == 'juno': - return policy_data_compat_juno - else: - raise Exception('Policy data for %s not available' % compat) diff --git a/magnum/tests/policy_fixture.py b/magnum/tests/policy_fixture.py index 574a03a156..28e1bb1bad 100644 --- a/magnum/tests/policy_fixture.py +++ b/magnum/tests/policy_fixture.py @@ -26,15 +26,13 @@ CONF = cfg.CONF class PolicyFixture(fixtures.Fixture): - def __init__(self, compat=None): - self.compat = compat def _setUp(self): 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.get_policy_data(self.compat)) + policy_file.write(fake_policy.policy_data) policy_opts.set_defaults(CONF) CONF.set_override('policy_file', self.policy_file_name, 'oslo_policy') magnum_policy._ENFORCER = None