From: Jan Pokorný <jpokorny@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/2] code cleanup: Fix minor warning according to pylint
Date: Mon, 29 Oct 2012 21:02:54 +0100 [thread overview]
Message-ID: <20121029200254.GB17754@redhat.com> (raw)
In-Reply-To: <1351512638-8049-1-git-send-email-mgrac@redhat.com>
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("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE);
> -re_status = re.compile("<state>(.*?)</state>", re.IGNORECASE);
> -re_get_name = re.compile("<name>(.*?)</name>", re.IGNORECASE);
> +re_get_id = re.compile("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE)
> +re_status = re.compile("<state>(.*?)</state>", re.IGNORECASE)
> +re_get_name = re.compile("<name>(.*?)</name>", 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
prev parent reply other threads:[~2012-10-29 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 12:10 [Cluster-devel] [PATCH 1/2] code cleanup: Fix minor warning according to pylint Marek 'marx' Grac
2012-10-29 20:02 ` Jan Pokorný [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121029200254.GB17754@redhat.com \
--to=jpokorny@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).