Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes Python 2 compatibility code for spacecmd #9614

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
import re
import shlex
import gettext
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
import logging
import sys
import gettext
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/configchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
import base64
import codecs
import gettext
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/cryptokey.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
# pylint: disable=W0613

import gettext
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
# pylint: disable=C0103

import gettext
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib


from spacecmd.i18n import _N
from spacecmd.utils import *
Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
import os
import re
import shlex
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib


from spacecmd.i18n import _N
from spacecmd.utils import *
Expand Down
14 changes: 5 additions & 9 deletions spacecmd/src/spacecmd/kickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@
import os
from getpass import getpass
from operator import itemgetter
try:
from urllib2 import urlopen, HTTPError
except ImportError:
from urllib.request import urlopen
from urllib.error import HTTPError

from urllib.request import urlopen
from urllib.error import HTTPError
import re
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *
Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
# pylint: disable=C0103

import gettext
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@

import gettext
import shlex
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
import base64
import gettext
from operator import itemgetter
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
2 changes: 1 addition & 1 deletion spacecmd/src/spacecmd/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
class UnknownCallException(Exception):

def __init__(self):
Exception.__init__(self)
super().__init__(self)


class SpacewalkShell(Cmd):
Expand Down
18 changes: 6 additions & 12 deletions spacecmd/src/spacecmd/softwarechannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,12 @@
# pylint: disable=C0103

import gettext
try:
from urllib import ContentTooShortError
except ImportError:
from urllib.error import ContentTooShortError
try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from urllib.error import ContentTooShortError
from urllib.request import urlretrieve

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
6 changes: 2 additions & 4 deletions spacecmd/src/spacecmd/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
import gettext
import shlex
from datetime import datetime
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib
from xmlrpc import client as xmlrpclib

from getpass import getpass
from operator import itemgetter
from xml.parsers.expat import ExpatError
Expand Down
7 changes: 3 additions & 4 deletions spacecmd/src/spacecmd/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
import gettext
import shlex
from getpass import getpass
try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib

from xmlrpc import client as xmlrpclib

from spacecmd.i18n import _N
from spacecmd.utils import *

Expand Down
10 changes: 2 additions & 8 deletions spacecmd/src/spacecmd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@
import sys
import time
import argparse
from xmlrpc import client as xmlrpclib

try:
from xmlrpc import client as xmlrpclib
except ImportError:
import xmlrpclib
from collections import deque
from datetime import datetime, timedelta
from difflib import unified_diff
Expand All @@ -53,10 +50,7 @@
from subprocess import Popen, PIPE
from dateutil.parser import isoparse

try:
import json
except ImportError:
import simplejson as json # python < 2.6
import json

import rpm

Expand Down
Loading