Skip to content

Commit

Permalink
ci: fixing linter error
Browse files Browse the repository at this point in the history
Fixing linter error (using variable 'urllib' before assignment)
Adding logic to properly import urlencode depending on python version

closes: rook#12985

Signed-off-by: Redouane Kachach <[email protected]>
(cherry picked from commit aa59e3b)
  • Loading branch information
rkachach authored and parth-gr committed Oct 5, 2023
1 parent 276ee1e commit 923fd5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deploy/examples/create-external-cluster-resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
try:
# for 2.7.x
from urlparse import urlparse
from urllib import urlencode as urlencode
except ModuleNotFoundError:
# for 3.x
from urllib.parse import urlparse
from urllib.parse import urlencode as urlencode

try:
from base64 import encodestring
Expand Down Expand Up @@ -1363,7 +1365,7 @@ def get_rgw_fsid(self, base_url, verify):
rgw_endpoint = self._arg_parser.rgw_endpoint
base_url = base_url + "://" + rgw_endpoint + "/admin/info?"
params = {"format": "json"}
request_url = base_url + urllib.parse.urlencode(params)
request_url = base_url + urlencode(params)

try:
r = requests.get(
Expand Down

0 comments on commit 923fd5c

Please sign in to comment.