From 7aecc6ab4f248092d93557c932e0a8a332066744 Mon Sep 17 00:00:00 2001 From: Stephane Thiell Date: Tue, 7 Feb 2023 22:47:04 -0800 Subject: [PATCH] NodeSet: a few minor code fixes From pylint: NodeSet.py:63:0: C0413: Import "from ClusterShell.Defaults import config_paths, DEFAULTS" should be placed at the top of the module (wrong-import-position) NodeSet.py:68:0: W0611: Unused RangeSetException imported from ClusterShell.RangeSet (unused-import) NodeSet.py:69:0: W0611: Unused RangeSetPaddingError imported from ClusterShell.RangeSet (unused-import) --- lib/ClusterShell/NodeSet.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/ClusterShell/NodeSet.py b/lib/ClusterShell/NodeSet.py index 2127affe..18ad449b 100644 --- a/lib/ClusterShell/NodeSet.py +++ b/lib/ClusterShell/NodeSet.py @@ -54,21 +54,20 @@ import string import sys -# Python 3 compatibility -try: - basestring -except NameError: - basestring = str - from ClusterShell.Defaults import config_paths, DEFAULTS import ClusterShell.NodeUtils as NodeUtils # Import all RangeSet module public objects from ClusterShell.RangeSet import RangeSet, RangeSetND, AUTOSTEP_DISABLED -from ClusterShell.RangeSet import RangeSetException, RangeSetParseError -from ClusterShell.RangeSet import RangeSetPaddingError +from ClusterShell.RangeSet import RangeSetParseError +# Python 3 compatibility +try: + basestring +except NameError: + basestring = str + # Define default GroupResolver object used by NodeSet DEF_GROUPS_CONFIGS = config_paths('groups.conf') ILLEGAL_GROUP_CHARS = set("@,!&^*")