11807: Migrate old records in jobs table from YAML to JSON.
[arvados.git] / services / nodemanager / arvnodeman / config.py
index f4ffff5fb60a23598d03fcea38a47d09af945ead..a16e0a8e62bac7930c3c4e6dfcded4cca21b2c3a 100644 (file)
@@ -14,11 +14,15 @@ from apiclient import errors as apierror
 
 from .baseactor import BaseNodeManagerActor
 
+from libcloud.common.types import LibcloudError
+from libcloud.common.exceptions import BaseHTTPError
+
 # IOError is the base class for socket.error, ssl.SSLError, and friends.
 # It seems like it hits the sweet spot for operations we want to retry:
 # it's low-level, but unlikely to catch code bugs.
 NETWORK_ERRORS = (IOError,)
 ARVADOS_ERRORS = NETWORK_ERRORS + (apierror.Error,)
+CLOUD_ERRORS = NETWORK_ERRORS + (LibcloudError, BaseHTTPError)
 
 actor_class = BaseNodeManagerActor
 
@@ -53,7 +57,7 @@ class NodeManagerConfig(ConfigParser.SafeConfigParser):
             'Manage': {'address': '127.0.0.1',
                        'port': '-1'},
             'Logging': {'file': '/dev/stderr',
-                        'level': 'WARNING'},
+                        'level': 'WARNING'}
         }.iteritems():
             if not self.has_section(sec_name):
                 self.add_section(sec_name)
@@ -107,7 +111,7 @@ class NodeManagerConfig(ConfigParser.SafeConfigParser):
         module = importlib.import_module('arvnodeman.computenode.driver.' +
                                          self.get('Cloud', 'provider'))
         driver_class = module.ComputeNodeDriver.DEFAULT_DRIVER
-        if self.get('Cloud', 'driver_class'):
+        if self.has_option('Cloud', 'driver_class'):
             d = self.get('Cloud', 'driver_class').split('.')
             mod = '.'.join(d[:-1])
             cls = d[-1]