diff options
author | Brent Baude <bbaude@redhat.com> | 2015-05-29 09:18:49 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2015-05-29 09:18:49 -0500 |
commit | 3c01b8e48400697362f190984ab9c96dee27a369 (patch) | |
tree | 6dfcfea791787504417fdecfa513ef7c9bfe0101 | |
parent | 3aa0fcc5983416d743fac6af1d40ca791feb23af (diff) | |
download | vyos-cloud-init-3c01b8e48400697362f190984ab9c96dee27a369.tar.gz vyos-cloud-init-3c01b8e48400697362f190984ab9c96dee27a369.zip |
Corrected spelling error on variable name
-rw-r--r-- | cloudinit/config/cc_rh_subscription.py | 6 | ||||
-rw-r--r-- | tests/unittests/test_rh_subscription.py | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py index e57e8a07..cabebca4 100644 --- a/cloudinit/config/cc_rh_subscription.py +++ b/cloudinit/config/cc_rh_subscription.py @@ -62,12 +62,12 @@ def handle(_name, cfg, _cloud, log, _args): return_stat = sm.update_repos(sm.enable_repo, sm.disable_repo) if not return_stat: raise SubscriptionError("Unable to add or remove repos") - sm.log_sucess("rh_subscription plugin completed successfully") + sm.log_success("rh_subscription plugin completed successfully") except SubscriptionError as e: sm.log_warn(str(e)) sm.log_warn("rh_subscription plugin did not complete successfully") else: - sm.log_sucess("System is already registered") + sm.log_success("System is already registered") class SubscriptionError(Exception): @@ -97,7 +97,7 @@ class SubscriptionManager(object): self.subman = ['subscription-manager'] self.is_registered = self._is_registered() - def log_sucess(self, msg): + def log_success(self, msg): '''Simple wrapper for logging info messages. Useful for unittests''' self.log.info(msg) diff --git a/tests/unittests/test_rh_subscription.py b/tests/unittests/test_rh_subscription.py index 2f813f41..38d5763a 100644 --- a/tests/unittests/test_rh_subscription.py +++ b/tests/unittests/test_rh_subscription.py @@ -36,17 +36,17 @@ class GoodTests(unittest.TestCase): ''' with mock.patch.object(cc_rh_subscription.SubscriptionManager, '_sub_man_cli') as mockobj: - self.SM.log_sucess = mock.MagicMock() + self.SM.log_success = mock.MagicMock() self.handle(self.name, self.config, self.cloud_init, self.log, self.args) - self.assertEqual(self.SM.log_sucess.call_count, 1) + self.assertEqual(self.SM.log_success.call_count, 1) self.assertEqual(mockobj.call_count, 1) def test_simple_registration(self): ''' Simple registration with username and password ''' - self.SM.log_sucess = mock.MagicMock() + self.SM.log_success = mock.MagicMock() reg = "The system has been registered with ID:" \ " 12345678-abde-abcde-1234-1234567890abc" self.SM._sub_man_cli = mock.MagicMock( @@ -60,7 +60,7 @@ class GoodTests(unittest.TestCase): logstring_val=True), self.SM._sub_man_cli.call_args_list) - self.assertEqual(self.SM.log_sucess.call_count, 1) + self.assertEqual(self.SM.log_success.call_count, 1) self.assertEqual(self.SM._sub_man_cli.call_count, 2) def test_full_registration(self): @@ -73,7 +73,7 @@ class GoodTests(unittest.TestCase): call_lists.append(['repos', '--enable=repo2', '--enable=repo3', '--disable=repo5']) call_lists.append(['attach', '--auto', '--servicelevel=self-support']) - self.SM.log_sucess = mock.MagicMock() + self.SM.log_success = mock.MagicMock() reg = "The system has been registered with ID:" \ " 12345678-abde-abcde-1234-1234567890abc" self.SM._sub_man_cli = mock.MagicMock( @@ -88,7 +88,7 @@ class GoodTests(unittest.TestCase): self.log, self.args) for call in call_lists: self.assertIn(mock.call(call), self.SM._sub_man_cli.call_args_list) - self.assertEqual(self.SM.log_sucess.call_count, 1) + self.assertEqual(self.SM.log_success.call_count, 1) self.assertEqual(self.SM._sub_man_cli.call_count, 9) |