From: Thierry Parmentelat Date: Mon, 11 Dec 2006 13:02:41 +0000 (+0000) Subject: removes requirement that /etc/planetlab/plc_config should exist, for use on non-myplc... X-Git-Tag: pycurl-7_13_1~206 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=93a6ed94c2f71f4f44a4d4487c442efe9df0c435;p=plcapi.git removes requirement that /etc/planetlab/plc_config should exist, for use on non-myplc boxes --- diff --git a/Shell.py b/Shell.py index e29f0397..ff93c66c 100755 --- a/Shell.py +++ b/Shell.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2005 The Trustees of Princeton University # -# $Id: Shell.py,v 1.14 2006/12/05 16:25:26 thierry Exp $ +# $Id: Shell.py,v 1.15 2006/12/11 11:56:37 thierry Exp $ # import os, sys @@ -53,7 +53,13 @@ class Shell: if config is not None: self.config=config else: - self.config = "/etc/planetlab/plc_config" + # support running on non-myplc boxes + default_config_file = "/etc/planetlab/plc_config" + try: + open (default_config_file).close() + except: + default_config_file="/dev/null" + self.config = default_config_file self.url = None self.method = None self.user = None