cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Marek Grac <mgrac@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/2] fence_amt: new fence agent for Intel AMT
Date: Thu, 19 Dec 2013 16:40:21 +0100	[thread overview]
Message-ID: <52B31365.8070201@redhat.com> (raw)
In-Reply-To: <1907891632.3279962.1386084496717.JavaMail.root@redhat.com>

Hi Ondrej,

On 12/03/2013 04:28 PM, Ondrej Mular wrote:
> +def reboot_cycle(_, options):
> +    cmd = create_command(options, "cycle")
> +
> +    if options["log"] >= LOG_MODE_VERBOSE:
> +        options["debug_fh"].write("executing: " + cmd + "\n")
> +
> +    null = open('/dev/null', 'w')
> +    try:
> +        process = subprocess.Popen(cmd, stdout=null, stderr=null, shell=True)
> +    except OSError:
> +        null.close()
> +        fail_usage("Amttool not found or not accessible")
> +
I would suggest to stdout/stderr point to options["debug_fh"] so we can 
use this information.

> +def is_executable(path):
> +    if os.path.exists(path):
> +        stats = os.stat(path)
> +        if stat.S_ISREG(stats.st_mode) and os.access(path, os.X_OK):
> +            return True
> +    return False
imho this function is not needed because you have to check and control 
this after each subprocess.Popen() ; if you believe it is a good idea to 
have such function (I'm not totally against it) then put it in fencing 
library.

I have no other comments, good work

m,



  reply	other threads:[~2013-12-19 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <956669175.3277212.1386083353560.JavaMail.root@redhat.com>
2013-12-03 15:28 ` [Cluster-devel] [PATCH 2/2] fence_amt: new fence agent for Intel AMT Ondrej Mular
2013-12-19 15:40   ` Marek Grac [this message]
     [not found] <930308315.2340076.1385046294848.JavaMail.root@redhat.com>
2013-11-21 15:16 ` Ondrej Mular

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=52B31365.8070201@redhat.com \
    --to=mgrac@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).