Merge branch 'master' into 9161-node-state-fixes
[arvados.git] / services / nodemanager / arvnodeman / config.py
index af9c8c0ced908c75d635fea17efeb077de38af63..15891a92bcf8a7fdd5365595489e5efe96a5e0cd 100644 (file)
@@ -5,7 +5,6 @@ from __future__ import absolute_import, print_function
 import ConfigParser
 import importlib
 import logging
-import ssl
 import sys
 
 import arvados
@@ -13,13 +12,15 @@ import httplib2
 import pykka
 from apiclient import errors as apierror
 
-# IOError is the base class for socket.error and friends.
+from .baseactor import BaseNodeManagerActor
+
+# 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, ssl.SSLError)
+NETWORK_ERRORS = (IOError,)
 ARVADOS_ERRORS = NETWORK_ERRORS + (apierror.Error,)
 
-actor_class = pykka.ThreadingActor
+actor_class = BaseNodeManagerActor
 
 class NodeManagerConfig(ConfigParser.SafeConfigParser):
     """Node Manager Configuration class.
@@ -117,7 +118,10 @@ class NodeManagerConfig(ConfigParser.SafeConfigParser):
             sec_words = sec_name.split(None, 2)
             if sec_words[0] != 'Size':
                 continue
-            size_kwargs[sec_words[1]] = self.get_section(sec_name, int)
+            size_spec = self.get_section(sec_name, int)
+            if 'price' in size_spec:
+                size_spec['price'] = float(size_spec['price'])
+            size_kwargs[sec_words[1]] = size_spec
         # EC2 node sizes are identified by id. GCE sizes are identified by name.
         matching_sizes = []
         for size in all_sizes: