From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Pokorný Date: Mon, 29 Oct 2012 21:02:54 +0100 Subject: [Cluster-devel] [PATCH 1/2] code cleanup: Fix minor warning according to pylint In-Reply-To: <1351512638-8049-1-git-send-email-mgrac@redhat.com> References: <1351512638-8049-1-git-send-email-mgrac@redhat.com> Message-ID: <20121029200254.GB17754@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello Marx, On 29/10/12 13:10 +0100, Marek 'marx' Grac wrote: > diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py > index 9bb9581..c6f16ff 100644 > --- a/fence/agents/rhevm/fence_rhevm.py > +++ b/fence/agents/rhevm/fence_rhevm.py > @@ -12,9 +12,9 @@ BUILD_DATE="March, 2008" > #END_VERSION_GENERATION > > > -re_get_id = re.compile(" -re_status = re.compile("(.*?)", re.IGNORECASE); > -re_get_name = re.compile("(.*?)", re.IGNORECASE); > +re_get_id = re.compile(" +re_status = re.compile("(.*?)", re.IGNORECASE) > +re_get_name = re.compile("(.*?)", re.IGNORECASE) 3rd line keeps the trailing white-space (might be fixed as well) > diff --git a/fence/agents/xenapi/fence_xenapi.py b/fence/agents/xenapi/fence_xenapi.py > index 017908f..f583ea5 100644 > --- a/fence/agents/xenapi/fence_xenapi.py > +++ b/fence/agents/xenapi/fence_xenapi.py > @@ -137,18 +139,18 @@ def connect_and_login(options): > > try: > # Create the XML RPC session to the specified URL. > - session = XenAPI.Session(url); > + session = XenAPI.Session(url) > # Login using the supplied credentials. > - session.xenapi.login_with_password(username, password); > + session.xenapi.login_with_password(username, password) > except Exception, exn: > - print str(exn); > + print str(exn) > # http://sources.redhat.com/cluster/wiki/FenceAgentAPI says that for no connectivity > # the exit value should be 1. It doesn't say anything about failed logins, so > # until I hear otherwise it is best to keep this exit the same to make sure that > # anything calling this script (that uses the same information in the web page > # above) knows that this is an error condition, not a msg signifying a down port. > - sys.exit(EC_BAD_SESSION); > - return session; > + sys.exit(EC_BAD_SESSION) > + return session sys.exit line ditto BTW. pylint should be capable of trailing whitespace detection (W291?). -- Jan