Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100632
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Ganesh Pal <ganesh1pal@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | How to ignore error with anon-zero exit status |
| Date | Sun, 20 Dec 2015 23:00:27 +0530 |
| Lines | 38 |
| Message-ID | <mailman.4.1450632635.2237.python-list@python.org> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de 7JVRnmhqVpOGYizddH/rHwHgbiUDP26lgbgF1IVPTVrA== |
| Return-Path | <ganesh1pal@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; '"""': 0.05; 'exit': 0.07; 'skip:/ 10': 0.07; 'subject:How': 0.09; 'cmd': 0.09; 'fails.': 0.09; 'subject:ignore': 0.09; 'python': 0.10; 'subject:error': 0.11; 'exception': 0.13; 'def': 0.13; 'ignore': 0.14; 'e))': 0.16; 'err,': 0.16; 'i.e': 0.16; 'inputs': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'try:': 0.18; 'to:name:python- list@python.org': 0.20; '%s"': 0.22; 'linux': 0.26; 'appreciated.': 0.27; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; '2.6': 0.27; 'ret': 0.29; 'code': 0.30; 'run': 0.33; 'file': 0.34; 'except': 0.34; 'add': 0.34; 'received:google.com': 0.35; 'false': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'received:209': 0.38; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'rare': 0.66; 'subject:status': 0.84; 'succeeds': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=McYHgPjhGOCrqicv/Jcjwi40AR2+C4IBmma27qWIWvY=; b=NS8hAqrbcSaElAUeFJMkFglUyh7haFdUAOh02jz3vjY5kVnnR5rJcjij7XtmWgrw5Q NXRgk+WwcboHhxAQg91Nzw0VF9BAm52CUA7E/jlb84YMT9MFGvKOHDw7XDWs2/veR1qO kiEnDAJtMDODKdZjvHeY6HHR9vnDd8nA5kdpTTmuM/arT52IpzwIDOKREdcasL59E2U8 2apaPHLcrsBxJxn32o2/DMsqM7NaBNmXcqPJ04zbXV1wCGLOq6aj3gbPMIjRp+xEFdUu 4W8vFSz8jIU1GmSHdMlcPTDH5esZiy7zrnqSqRazvsZls7j16PpeW2UZxVcQkPy3aEQi 9NTg== |
| X-Received | by 10.112.165.69 with SMTP id yw5mr4891089lbb.1.1450632627060; Sun, 20 Dec 2015 09:30:27 -0800 (PST) |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:100632 |
Show key headers only | View raw
def run_scanner():
"""
Mount /filesystems and run scanner
"""
for cmd in [" mount /filesystems ", " scanner_start"]:
try:
out, err, ret = run(cmd, timeout=3600)
if ret != 0:
logging.error("Can't run %s got %s (%d)!" % (cmd, err, ret))
return False
except Exception as e:
logging.exception("Failed to run %s got %s" % (cmd, e))
return False
logging.info("Mount /tmp.....Done !!!")
time.sleep(30)
Iam on python 2.6 and Linux , I need you inputs on how to ignore an
specific error when the mount fails
In general the mount has zero status if it succeeds and anon-zero exit
status if it fails.
1.But for one rare case the mount succeeds but returns anon-zero exit
status and when we get “Reading GUID from da0xxx: No such file or
directory” error , how to ignore this error and proceed with the above
code
2. Also need to add this check only for mount case i.e mount
/filesystems and not scanner_start
Any recommendations would be appreciated.
Regards,
Ganesh
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
How to ignore error with anon-zero exit status Ganesh Pal <ganesh1pal@gmail.com> - 2015-12-20 23:00 +0530
Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-20 22:22 +0100
Re: Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) Chris Angelico <rosuav@gmail.com> - 2015-12-21 08:56 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-20 23:46 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-21 10:09 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 08:51 +0100
Re: Ignore error with non-zero exit status Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-21 12:58 +0000
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 14:19 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 00:23 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 15:05 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 01:11 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 15:19 +0100
Re: Ignore error with non-zero exit status Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-21 16:07 +0000
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:30 +0100
Re: Ignore error with non-zero exit status Random832 <random832@fastmail.com> - 2015-12-21 11:30 -0500
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:27 +0100
Re: Ignore error with non-zero exit status Steven D'Aprano <steve@pearwood.info> - 2015-12-22 10:32 +1100
Re: Ignore error with non-zero exit status Terry Reedy <tjreedy@udel.edu> - 2015-12-21 18:53 -0500
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 13:17 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 11:05 +1100
Re: Ignore error with non-zero exit status Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 17:17 -0700
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 11:25 +1100
Re: Ignore error with non-zero exit status Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 13:30 -0700
Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ben Finney <ben+python@benfinney.id.au> - 2015-12-22 07:58 +1100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 14:16 -0700
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-12-21 21:44 +0000
Re: Meaning and purpose of the Subject field Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:55 +0100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Steven D'Aprano <steve@pearwood.info> - 2015-12-22 10:14 +1100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-12-21 23:24 +0000
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 16:57 -0700
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Tim Chase <python.list@tim.thechases.com> - 2015-12-22 09:56 -0600
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Cameron Simpson <cs@zip.com.au> - 2015-12-22 14:36 +1100
Re: Meaning and purpose of the Subject field Random832 <random832@fastmail.com> - 2015-12-21 23:22 -0500
Re: Meaning and purpose of the Subject field Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 13:26 +0100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Grant Edwards <invalid@invalid.invalid> - 2015-12-22 15:17 +0000
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-22 08:28 -0700
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Grant Edwards <invalid@invalid.invalid> - 2015-12-22 22:32 +0000
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-21 16:55 -0500
Re: Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) Ganesh Pal <ganesh1pal@gmail.com> - 2015-12-21 08:22 +0530
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 08:54 +0100
csiph-web