Commit 5c55e0e9 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Check whether the configuration file actually exists.

parent b35ab356
...@@ -29,6 +29,7 @@ import slapos.slap.slap ...@@ -29,6 +29,7 @@ import slapos.slap.slap
from slapos.slap import ResourceNotReady from slapos.slap import ResourceNotReady
import sys import sys
import os
from optparse import OptionParser, Option from optparse import OptionParser, Option
import ConfigParser import ConfigParser
...@@ -61,6 +62,8 @@ class Parser(OptionParser): ...@@ -61,6 +62,8 @@ class Parser(OptionParser):
(options, args) = self.parse_args() (options, args) = self.parse_args()
if len(args) == 0: if len(args) == 0:
self.error("Incorrect number of arguments") self.error("Incorrect number of arguments")
elif not os.path.isfile(args[0]):
self.error("%s: Not found or not a regular file." % args[0])
return options, args return options, args
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment