You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2022/03/05 17:17:30 UTC

[GitHub] [libcloud] Kami opened a new pull request #1660: [WIP] Fix OpenStack authentication regressions

Kami opened a new pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660


   This PR fixes inadvertent regressions introduced in #1557 which broke some of the OpenStack authentication methods.
   
   Issue reported by @LanderOtto via #1659.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter edited a comment on pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#issuecomment-1059817292


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1660](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e8d45d1) into [trunk](https://codecov.io/gh/apache/libcloud/commit/332476d38d5d5797123b35222603cc007df71f32?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (332476d) will **increase** coverage by `0.03%`.
   > The diff coverage is `94.73%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1660/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##            trunk    #1660      +/-   ##
   ==========================================
   + Coverage   83.21%   83.25%   +0.03%     
   ==========================================
     Files         400      400              
     Lines       87040    87112      +72     
     Branches     9242     9249       +7     
   ==========================================
   + Hits        72433    72523      +90     
   + Misses      11463    11446      -17     
   + Partials     3144     3143       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libcloud/common/openstack\_identity.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvY29tbW9uL29wZW5zdGFja19pZGVudGl0eS5weQ==) | `84.40% <ø> (+2.38%)` | :arrow_up: |
   | [libcloud/test/compute/test\_openstack.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3Rfb3BlbnN0YWNrLnB5) | `94.62% <94.73%> (-0.01%)` | :arrow_down: |
   | [libcloud/common/openstack.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvY29tbW9uL29wZW5zdGFjay5weQ==) | `85.43% <0.00%> (+1.45%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [332476d...e8d45d1](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#issuecomment-1059812315


   OK, I managed to get all the tests to pass - the reason why that test was failing was my fault - I removed a version constant I thought it's unused, but it turns out it's actually used internally, just not directly exposed to the end user.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter commented on pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#issuecomment-1059817292


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1660](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (db8ca7f) into [trunk](https://codecov.io/gh/apache/libcloud/commit/332476d38d5d5797123b35222603cc007df71f32?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (332476d) will **increase** coverage by `0.03%`.
   > The diff coverage is `94.73%`.
   
   > :exclamation: Current head db8ca7f differs from pull request most recent head e8d45d1. Consider uploading reports for the commit e8d45d1 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1660/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##            trunk    #1660      +/-   ##
   ==========================================
   + Coverage   83.21%   83.25%   +0.03%     
   ==========================================
     Files         400      400              
     Lines       87040    87112      +72     
     Branches     9242     9249       +7     
   ==========================================
   + Hits        72433    72523      +90     
   + Misses      11463    11446      -17     
   + Partials     3144     3143       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libcloud/common/openstack\_identity.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvY29tbW9uL29wZW5zdGFja19pZGVudGl0eS5weQ==) | `84.40% <ø> (+2.38%)` | :arrow_up: |
   | [libcloud/test/compute/test\_openstack.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3Rfb3BlbnN0YWNrLnB5) | `94.62% <94.73%> (-0.01%)` | :arrow_down: |
   | [libcloud/common/openstack.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvY29tbW9uL29wZW5zdGFjay5weQ==) | `85.43% <0.00%> (+1.45%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [332476d...e8d45d1](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on pull request #1660: [WIP] Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#issuecomment-1059799915


   All the new unit tests I added pass with two small changes / fixes in `libcloud/common/openstack_identity.py`, but I haven't actually tested all the authentication methods end to end with an actual OpenStack installation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami merged pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
Kami merged pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter edited a comment on pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#issuecomment-1059817292


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1660](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2751218) into [trunk](https://codecov.io/gh/apache/libcloud/commit/332476d38d5d5797123b35222603cc007df71f32?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (332476d) will **increase** coverage by `0.03%`.
   > The diff coverage is `94.80%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1660/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##            trunk    #1660      +/-   ##
   ==========================================
   + Coverage   83.21%   83.25%   +0.03%     
   ==========================================
     Files         400      400              
     Lines       87040    87113      +73     
     Branches     9242     9249       +7     
   ==========================================
   + Hits        72433    72524      +91     
   + Misses      11463    11446      -17     
   + Partials     3144     3143       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libcloud/test/compute/test\_openstack.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3Rfb3BlbnN0YWNrLnB5) | `94.62% <94.73%> (-0.01%)` | :arrow_down: |
   | [libcloud/common/openstack\_identity.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvY29tbW9uL29wZW5zdGFja19pZGVudGl0eS5weQ==) | `84.42% <100.00%> (+2.40%)` | :arrow_up: |
   | [libcloud/common/openstack.py](https://codecov.io/gh/apache/libcloud/pull/1660/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvY29tbW9uL29wZW5zdGFjay5weQ==) | `85.43% <0.00%> (+1.45%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [332476d...2751218](https://codecov.io/gh/apache/libcloud/pull/1660?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] dpeschman commented on a change in pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
dpeschman commented on a change in pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#discussion_r821042778



##########
File path: libcloud/test/compute/test_openstack.py
##########
@@ -3989,6 +4076,76 @@ def test_auth_user_info_is_set(self):
         )
 
 
+class OpenStack_AuthVersions_Tests(unittest.TestCase):
+    def setUp(self):
+        # monkeypatch get_endpoint because the base openstack driver doesn't actually
+        # work with old devstack but this class/tests are still used by the rackspace
+        # driver
+        self.originalGetEndpoint = OpenStack_1_1_NodeDriver.connectionCls.get_endpoint
+        self.originalConnectionCls = OpenStack_1_1_NodeDriver.connectionCls
+
+        def get_endpoint(*args, **kwargs):
+            return "https://servers.api.rackspacecloud.com/v1.0/slug"
+
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = get_endpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = (
+            OpenStack_AllAuthVersions_MockHttp
+        )
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def tearDown(self):
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = self.originalGetEndpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = self.originalConnectionCls
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def test_ex_force_auth_version_all_possible_values(self):
+        """
+        Test case which verifies that the driver can be correctly instantiated using all the
+        supported API versions.
+        """
+        cls = get_driver(Provider.OPENSTACK)
+
+        for auth_version in AUTH_VERSIONS_WITH_EXPIRES:
+            driver_kwargs = {}
+
+            if auth_version in ["1.1", "3.0"]:
+                # 1.1 is old and deprecated, 3.0 is not exposed directly to the endu ser

Review comment:
       "endu ser" should be "end user".




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] dpeschman commented on a change in pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
dpeschman commented on a change in pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#discussion_r821042778



##########
File path: libcloud/test/compute/test_openstack.py
##########
@@ -3989,6 +4076,76 @@ def test_auth_user_info_is_set(self):
         )
 
 
+class OpenStack_AuthVersions_Tests(unittest.TestCase):
+    def setUp(self):
+        # monkeypatch get_endpoint because the base openstack driver doesn't actually
+        # work with old devstack but this class/tests are still used by the rackspace
+        # driver
+        self.originalGetEndpoint = OpenStack_1_1_NodeDriver.connectionCls.get_endpoint
+        self.originalConnectionCls = OpenStack_1_1_NodeDriver.connectionCls
+
+        def get_endpoint(*args, **kwargs):
+            return "https://servers.api.rackspacecloud.com/v1.0/slug"
+
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = get_endpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = (
+            OpenStack_AllAuthVersions_MockHttp
+        )
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def tearDown(self):
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = self.originalGetEndpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = self.originalConnectionCls
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def test_ex_force_auth_version_all_possible_values(self):
+        """
+        Test case which verifies that the driver can be correctly instantiated using all the
+        supported API versions.
+        """
+        cls = get_driver(Provider.OPENSTACK)
+
+        for auth_version in AUTH_VERSIONS_WITH_EXPIRES:
+            driver_kwargs = {}
+
+            if auth_version in ["1.1", "3.0"]:
+                # 1.1 is old and deprecated, 3.0 is not exposed directly to the endu ser

Review comment:
       "endu ser" shoudl be "end user".




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on pull request #1660: [WIP] Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#issuecomment-1059802458


   It looks like that after making those other tests pass, new auth cache related tests are now failing (it seems like auth cache is not being correctly used in some scenarios / auth version, but didn't dig in too much yet).
   
    Probably best to wait @dpeschman since he's the most familiar with that piece of code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on a change in pull request #1660: Fix OpenStack authentication regressions

Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1660:
URL: https://github.com/apache/libcloud/pull/1660#discussion_r821982571



##########
File path: libcloud/test/compute/test_openstack.py
##########
@@ -3989,6 +4076,76 @@ def test_auth_user_info_is_set(self):
         )
 
 
+class OpenStack_AuthVersions_Tests(unittest.TestCase):
+    def setUp(self):
+        # monkeypatch get_endpoint because the base openstack driver doesn't actually
+        # work with old devstack but this class/tests are still used by the rackspace
+        # driver
+        self.originalGetEndpoint = OpenStack_1_1_NodeDriver.connectionCls.get_endpoint
+        self.originalConnectionCls = OpenStack_1_1_NodeDriver.connectionCls
+
+        def get_endpoint(*args, **kwargs):
+            return "https://servers.api.rackspacecloud.com/v1.0/slug"
+
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = get_endpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = (
+            OpenStack_AllAuthVersions_MockHttp
+        )
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def tearDown(self):
+        OpenStack_1_1_NodeDriver.connectionCls.get_endpoint = self.originalGetEndpoint
+        OpenStack_1_1_NodeDriver.connectionCls.conn_class = self.originalConnectionCls
+
+        OpenStackMockHttp.type = None
+        OpenStack_1_1_MockHttp.type = None
+        OpenStack_2_0_MockHttp.type = None
+
+    def test_ex_force_auth_version_all_possible_values(self):
+        """
+        Test case which verifies that the driver can be correctly instantiated using all the
+        supported API versions.
+        """
+        cls = get_driver(Provider.OPENSTACK)
+
+        for auth_version in AUTH_VERSIONS_WITH_EXPIRES:
+            driver_kwargs = {}
+
+            if auth_version in ["1.1", "3.0"]:
+                # 1.1 is old and deprecated, 3.0 is not exposed directly to the endu ser

Review comment:
       Fixed, thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org