summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-12-16 14:42:10 -0600
committerGeorge Kraft <george.kraft@calxeda.com>2013-12-16 14:43:57 -0600
commit5dc0d30fe656d67b8320b58b14a2e69f54dfb9e7 (patch)
tree43396096eff9886b2fe66b9e09dbd6313d77760f
parent45902a82a81c800ecfee03c5941493728118eccd (diff)
downloadcxmanage-5dc0d30fe656d67b8320b58b14a2e69f54dfb9e7.tar.gz
nojira: clean up some additional pylint warnings
-rw-r--r--cxmanage_api/cli/__init__.py4
-rw-r--r--cxmanage_api/credentials.py4
-rw-r--r--cxmanage_api/decorators.py4
-rw-r--r--cxmanage_api/fabric.py20
-rw-r--r--cxmanage_api/node.py4
5 files changed, 20 insertions, 16 deletions
diff --git a/cxmanage_api/cli/__init__.py b/cxmanage_api/cli/__init__.py
index 033edec..00a7886 100644
--- a/cxmanage_api/cli/__init__.py
+++ b/cxmanage_api/cli/__init__.py
@@ -1,6 +1,3 @@
-"""Calxeda: __init__.py """
-
-
# Copyright (c) 2012-2013, Calxeda Inc.
#
# All rights reserved.
@@ -31,6 +28,7 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
+"""Calxeda: __init__.py """
import sys
import time
diff --git a/cxmanage_api/credentials.py b/cxmanage_api/credentials.py
index 8709bf9..1a88f90 100644
--- a/cxmanage_api/credentials.py
+++ b/cxmanage_api/credentials.py
@@ -1,3 +1,5 @@
+# pylint: disable=too-few-public-methods
+
# Copyright (c) 2012-2013, Calxeda Inc.
#
# All rights reserved.
@@ -28,6 +30,8 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
+""" Definition of the Credentials class """
+
class Credentials(object):
""" Container for login credentials """
diff --git a/cxmanage_api/decorators.py b/cxmanage_api/decorators.py
index 2f5a3de..0b60a7a 100644
--- a/cxmanage_api/decorators.py
+++ b/cxmanage_api/decorators.py
@@ -1,3 +1,5 @@
+# pylint: disable=useless-else-on-loop
+
# Copyright (c) 2012-2013, Calxeda Inc.
#
# All rights reserved.
@@ -28,6 +30,8 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
+""" Decorators used in cxmanage_api """
+
from functools import wraps
diff --git a/cxmanage_api/fabric.py b/cxmanage_api/fabric.py
index 5a922b1..868a2dc 100644
--- a/cxmanage_api/fabric.py
+++ b/cxmanage_api/fabric.py
@@ -1,6 +1,8 @@
-# pylint: disable=C0302
-"""Calxeda: fabric.py """
-
+# pylint: disable=too-many-lines
+# pylint: disable=too-many-instance-attributes
+# pylint: disable=too-few-public-methods
+# pylint: disable=too-many-public-methods
+# pylint: disable=too-many-arguments
# Copyright (c) 2012-2013, Calxeda Inc.
#
@@ -32,6 +34,8 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
+""" Calxeda: fabric.py """
+
import time
import re
@@ -43,7 +47,6 @@ from cxmanage_api.cx_exceptions import CommandFailedError, IpmiError, \
TftpException, ParseError, TimeoutError
-# pylint: disable=R0902,R0903, R0904
class Fabric(object):
""" The Fabric class provides management of multiple nodes.
@@ -111,7 +114,6 @@ class Fabric(object):
return function
- # pylint: disable=R0913
def __init__(self, ip_address, credentials=None, tftp=None,
ecme_tftp_port=5001, task_queue=None, verbose=False,
node=None):
@@ -338,14 +340,14 @@ class Fabric(object):
filename = self.primary_node._run_fabric_command(
'fabric_config_get_networks'
)
- regex = re.compile('\d+ Network (\w+), private=(\d)')
+ regex = re.compile(r'\d+ Network (\w+), private=(\d)')
contents = open(filename, 'r').readlines()
for line in contents:
try:
name, private = regex.findall(line)[0]
results[name] = (int(private) != 0)
except IndexError:
- raise CommandFailedException(
+ raise CommandFailedError(
'Unable to parse networks: %s' % '\n'.join(contents)
)
@@ -933,7 +935,6 @@ class Fabric(object):
"""
return self._run_on_all_nodes(async, "get_ubootenv")
- # pylint: disable=R0913
def get_server_ip(self, interface=None, ipv6=False, aggressive=False,
async=False):
"""Get the server IP address from all nodes. The nodes must be powered
@@ -1324,6 +1325,3 @@ class Fabric(object):
if errors:
raise CommandFailedError(results, errors)
return results
-
-
-# End of file: ./fabric.py
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py
index f247495..0c624ad 100644
--- a/cxmanage_api/node.py
+++ b/cxmanage_api/node.py
@@ -1,6 +1,4 @@
# pylint: disable=C0302
-"""Calxeda: node.py"""
-
# Copyright (c) 2012-2013, Calxeda Inc.
#
@@ -32,6 +30,8 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
+"""Calxeda: node.py"""
+
import os
import re
import time