← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~bbaude/cloud-init:rh_sub_rm_first into cloud-init:master

 

Brent Baude has proposed merging ~bbaude/cloud-init:rh_sub_rm_first into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~bbaude/cloud-init/+git/cloud-init/+merge/309478
-- 
Your team cloud init development team is requested to review the proposed merge of ~bbaude/cloud-init:rh_sub_rm_first into cloud-init:master.
diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py
index d858f65..bd6b5f8 100644
--- a/cloudinit/config/cc_rh_subscription.py
+++ b/cloudinit/config/cc_rh_subscription.py
@@ -421,11 +421,12 @@ class SubscriptionManager(object):
                                "because it is not enabled".format(fail))
 
         cmd = ['repos']
-        if len(enable_list) > 0:
-            cmd.extend(enable_list)
         if len(disable_list) > 0:
             cmd.extend(disable_list)
 
+        if len(enable_list) > 0:
+            cmd.extend(enable_list)
+
         try:
             self._sub_man_cli(cmd)
         except util.ProcessExecutionError as e:
diff --git a/tests/unittests/test_rh_subscription.py b/tests/unittests/test_rh_subscription.py
index 891dbe7..7962387 100644
--- a/tests/unittests/test_rh_subscription.py
+++ b/tests/unittests/test_rh_subscription.py
@@ -83,8 +83,8 @@ class GoodTests(TestCase):
         '''
         call_lists = []
         call_lists.append(['attach', '--pool=pool1', '--pool=pool3'])
-        call_lists.append(['repos', '--enable=repo2', '--enable=repo3',
-                           '--disable=repo5'])
+        call_lists.append(['repos', '--disable=repo5', '--enable=repo2', 
+                           '--enable=repo3'])
         call_lists.append(['attach', '--auto', '--servicelevel=self-support'])
         self.SM.log_success = mock.MagicMock()
         reg = "The system has been registered with ID:" \

Follow ups