Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on no --pv-list file #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion arget
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ if opt.pvlist:
if opt.pvlist == '-':
AF = sys.stdin
else:
AF = open(opt.pvlist, 'r')
try:
AF = open(opt.pvlist, 'r')
except IOError:
print "--pv-list: No such file or directory: '%s'"%opt.pvlist
sys.exit(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error needs a non-zero return code.

args += filter(lambda L:len(L) and L[0]!='#', map(str.rstrip, AF.readlines()))
if opt.pvlist != '-':
AF.close()
Expand Down