Fixing linter error (using variable 'urllib' before assignment)
Adding logic to properly import urlencode depending on python version
closes: https://github.com/rook/rook/issues/12985
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit aa59e3bb86)