Skip to content

Commit

Permalink
Python 3 compatibility fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Aravinda VK <mail@aravindavk.in>
  • Loading branch information
aravindavk committed Nov 17, 2016
1 parent 7ba3fa5 commit 607baca
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 52 deletions.
28 changes: 14 additions & 14 deletions gluster/cli/__init__.py
Expand Up @@ -9,22 +9,22 @@
# cases as published by the Free Software Foundation.
#

__version__ = '0.1'
__version__ = '0.2'

import volume
import bitrot
import bricks
import georep
import peer
import quota
import snapshot
import heal
import nfs_ganesha
import rebalance
import tier
from . import volume
from . import bitrot
from . import bricks
from . import georep
from . import peer
from . import quota
from . import snapshot
from . import heal
from . import nfs_ganesha
from . import rebalance
from . import tier

from utils import (set_gluster_path,
GlusterCmdException)
from .utils import (set_gluster_path,
GlusterCmdException)

# Reexport
__all__ = ["volume",
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/bitrot.py
Expand Up @@ -8,8 +8,8 @@
# later), or the GNU General Public License, version 2 (GPLv2), in all
# cases as published by the Free Software Foundation.
#
from utils import bitrot_execute, bitrot_execute_xml, GlusterCmdException
from parsers import parse_bitrot_scrub_status
from .utils import bitrot_execute, bitrot_execute_xml, GlusterCmdException
from .parsers import parse_bitrot_scrub_status

THROTTLE_TYPES = ["lazy", "normal", "aggressive"]
FREQUENCY_TYPES = ["hourly", "daily", "weekly", "biweekly", "monthly"]
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/bricks.py
Expand Up @@ -8,8 +8,8 @@
# later), or the GNU General Public License, version 2 (GPLv2), in all
# cases as published by the Free Software Foundation.
#
from utils import volume_execute, volume_execute_xml
from parsers import parse_remove_brick_status
from .utils import volume_execute, volume_execute_xml
from .parsers import parse_remove_brick_status


def add(volname, bricks, stripe=None, replica=None, arbiter=None, force=False):
Expand Down
6 changes: 3 additions & 3 deletions gluster/cli/georep.py
Expand Up @@ -8,9 +8,9 @@
# later), or the GNU General Public License, version 2 (GPLv2), in all
# cases as published by the Free Software Foundation.
#
from utils import georep_execute, georep_execute_xml, gluster_system_execute
from parsers import parse_georep_config, parse_georep_status
import volume
from .utils import georep_execute, georep_execute_xml, gluster_system_execute
from .parsers import parse_georep_config, parse_georep_status
from . import volume


def gsec_create(ssh_key_prefix=True):
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/heal.py
Expand Up @@ -8,8 +8,8 @@
# later), or the GNU General Public License, version 2 (GPLv2), in all
# cases as published by the Free Software Foundation.
#
from utils import heal_execute, heal_execute_xml, GlusterCmdException
from parsers import parse_heal_statistics, parse_heal_info
from .utils import heal_execute, heal_execute_xml, GlusterCmdException
from .parsers import parse_heal_statistics, parse_heal_info


HEAL_INFO_TYPES = ["healed", "heal-failed", "split-brain"]
Expand Down
2 changes: 1 addition & 1 deletion gluster/cli/nfs_ganesha.py
Expand Up @@ -8,7 +8,7 @@
# later), or the GNU General Public License, version 2 (GPLv2), in all
# cases as published by the Free Software Foundation.
#
from utils import gluster_execute
from .utils import gluster_execute


def enable():
Expand Down
6 changes: 3 additions & 3 deletions gluster/cli/parsers.py
Expand Up @@ -332,7 +332,7 @@ def parse_georep_status(data, volinfo):
out[-1].append(gstatus[session][bname])
else:
# Offline Status
node, brick = bname.split(":")
node, brick_path = bname.split(":")
if "@" not in slave:
slave_user = "root"
else:
Expand All @@ -342,7 +342,7 @@ def parse_georep_status(data, volinfo):
"mastervol": mvol,
"slavevol": slave.split("::")[-1],
"master_node": node,
"master_brick": brick,
"master_brick": brick_path,
"slave_user": slave_user,
"slave": slave,
"slave_node": "N/A",
Expand All @@ -353,7 +353,7 @@ def parse_georep_status(data, volinfo):
"meta": "N/A",
"failures": "N/A",
"checkpoint_completed": "N/A",
"master_node_uuid": brick["hostUuid"],
"master_node_uuid": brick["uuid"],
"last_synced": "N/A",
"checkpoint_time": "N/A",
"checkpoint_completion_time": "N/A"
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/peer.py
Expand Up @@ -9,8 +9,8 @@
# cases as published by the Free Software Foundation.
#

from utils import peer_execute, peer_execute_xml, gluster_execute_xml
from parsers import parse_peer_status, parse_pool_list
from .utils import peer_execute, peer_execute_xml, gluster_execute_xml
from .parsers import parse_peer_status, parse_pool_list


def probe(host):
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/quota.py
Expand Up @@ -9,8 +9,8 @@
# cases as published by the Free Software Foundation.
#

from utils import quota_execute, quota_execute_xml, volume_execute
from parsers import parse_quota_list_paths, parse_quota_list_objects
from .utils import quota_execute, quota_execute_xml, volume_execute
from .parsers import parse_quota_list_paths, parse_quota_list_objects


def inode_quota_enable(volname):
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/rebalance.py
Expand Up @@ -9,8 +9,8 @@
# cases as published by the Free Software Foundation.
#

from utils import volume_execute, volume_execute_xml
from parsers import parse_rebalance_status
from .utils import volume_execute, volume_execute_xml
from .parsers import parse_rebalance_status


def fix_layout_start(volname):
Expand Down
8 changes: 4 additions & 4 deletions gluster/cli/snapshot.py
Expand Up @@ -9,10 +9,10 @@
# cases as published by the Free Software Foundation.
#

from utils import snapshot_execute, snapshot_execute_xml
from parsers import (parse_snapshot_status,
parse_snapshot_info,
parse_snapshot_list)
from .utils import snapshot_execute, snapshot_execute_xml
from .parsers import (parse_snapshot_status,
parse_snapshot_info,
parse_snapshot_list)


def activate(snapname, force=False):
Expand Down
4 changes: 2 additions & 2 deletions gluster/cli/tier.py
Expand Up @@ -9,8 +9,8 @@
# cases as published by the Free Software Foundation.
#

from utils import tier_execute, tier_execute_xml
from parsers import parse_tier_detach, parse_tier_status
from .utils import tier_execute, tier_execute_xml
from .parsers import parse_tier_detach, parse_tier_status


def status(volname):
Expand Down
25 changes: 12 additions & 13 deletions gluster/cli/volume.py
Expand Up @@ -9,22 +9,21 @@
# cases as published by the Free Software Foundation.
#

from utils import volume_execute, volume_execute_xml, GlusterCmdException
from parsers import (parse_volume_info,
parse_volume_status,
parse_volume_options,
parse_volume_list,
parse_volume_profile_info)
from .utils import volume_execute, volume_execute_xml, GlusterCmdException
from .parsers import (parse_volume_info,
parse_volume_status,
parse_volume_options,
parse_volume_list,
parse_volume_profile_info)

# Following import are not used in this file, but imported to make
# it available via volume.(noqa to ignore in pep8 check)
import bitrot # noqa
import bricks # noqa
import georep # noqa
import heal # noqa
import quota # noqa
import rebalance # noqa
import tier # noqa
from . import bitrot # noqa
from . import bricks # noqa
from . import heal # noqa
from . import quota # noqa
from . import rebalance # noqa
from . import tier # noqa


LOCK_KINDS = ["blocked", "granted", "all"]
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Expand Up @@ -52,6 +52,9 @@ def read(fname):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: System :: Filesystems',
],
)

0 comments on commit 607baca

Please sign in to comment.