diff --git a/README.org b/README.org index 92123089f627cfa0dcea8ba500cfafca4e26cb7a..94c33d436a7ab7830139290135fab136030f6e68 100644 --- a/README.org +++ b/README.org @@ -73,7 +73,8 @@ password: MYPASSWORD #+END_EXAMPLE #+BEGIN_hint -Inside Grid'5000, you'l probably need to set ~verify_ssl: False~ +From a Grid'5000 frontend this file is optionnal. In all other cases the +configuration file is mandatory. #+END_hint - Using a virtualenv is recommended (python 3.5+ is required) diff --git a/README.rst b/README.rst index a67a077d0b6ae2157c896d7f3d1bdca6455a53f9..05b83a2324ba94a921466cece350814603dcbca6 100644 --- a/README.rst +++ b/README.rst @@ -76,7 +76,8 @@ conform with the Grid5000 API models (with an ’s’!) .. hint:: - Inside Grid’5000, you’l probably need to set ``verify_ssl: False`` + From a Grid’5000 frontend this file is optionnal. In all other cases the + configuration file is mandatory. - Using a virtualenv is recommended (python 3.5+ is required) diff --git a/examples/vlan_set_2.py b/examples/vlan_set_2.py index fa9b154d27f508bacd724f5d617aa7c30fb84d3f..00476f94f726727568a37f6ba6fec48cdf84e9fb 100644 --- a/examples/vlan_set_2.py +++ b/examples/vlan_set_2.py @@ -11,7 +11,7 @@ logging.basicConfig(level=logging.DEBUG) def _to_network_address(host, interface): """Translate a host to a network address e.g: - paranoia-20.rennes.grid5000.fr -> paranoia-20-eth2.rennes.grid5000.fr + paravance-20.rennes.grid5000.fr -> paravance-20-eth2.rennes.grid5000.fr """ splitted = host.split('.') splitted[0] = splitted[0] + "-" + interface @@ -26,7 +26,7 @@ site = gk.sites["rennes"] job = site.jobs.create({"name": "pyg5k", "command": "sleep 3600", - "resources": "{type='kavlan'}/vlan=1+{cluster='paranoia'}nodes=1", + "resources": "{type='kavlan'}/vlan=1+{cluster='paravance'}nodes=1", "types": ["deploy"] }) diff --git a/grid5000/__init__.py b/grid5000/__init__.py index 39bdcc6f6175f073a3a62217aff368267e68be8e..168a7610c8f23e993cd63a274e1a0b8739a99ebb 100644 --- a/grid5000/__init__.py +++ b/grid5000/__init__.py @@ -91,9 +91,16 @@ class Grid5000(object): @classmethod def from_yaml(cls, yaml_file): - with open(yaml_file, "r") as f: - conf = yaml.load(f) - return cls(**conf) + try: + with open(yaml_file, "r") as f: + conf = yaml.load(f) + return cls(**conf) + except Exception as e: + logging.warn(e) + logging.info( + "...Falling back to anonymous connection" + ) + return cls() def __enter__(self): return self diff --git a/grid5000/__version__.py b/grid5000/__version__.py index 48fef3235794579e6ccc7e4ec49e8b5188c14101..b3f4756216d06217d275110297a69bbb7ea74a59 100644 --- a/grid5000/__version__.py +++ b/grid5000/__version__.py @@ -1 +1 @@ -__version__ = "0.1.2" \ No newline at end of file +__version__ = "0.1.2" diff --git a/tox.ini b/tox.ini index 9832552179036152e2018201fcf586f001096bb3..0a346506f6f1f85d84930ab3858e969865428a7b 100644 --- a/tox.ini +++ b/tox.ini @@ -31,3 +31,4 @@ ignore = E121,E122,E123,E124,E125,E127,E128,E129,E131,E241,H405,F821,W503,F405 show-source = true exclude = venv,.git,.tox,dist,*egg,ansible,tests max-complexity = 12 +max-line-length = 88