Remove generic controller settings API endpoint.

This commit is contained in:
grossmj committed 2018-11-14 16:24:30 +08:00
1 parent cebb56387a
commit 98f04365b7
15 files changed
+120 -118

No files matched your search

+20 -2
View File
@@ -76,6 +76,7 @@ class IOUVM(BaseNode):
self._started = False
self._nvram_watcher = None
self._path = self.manager.get_abs_image_path(path)
self._license_check = True
# IOU settings
self._ethernet_adapters = []
@@ -358,6 +359,16 @@ class IOUVM(BaseNode):
except OSError as e:
raise IOUError("Could not write the iourc file {}: {}".format(path, e))
@property
def license_check(self):
return self._license_check
@license_check.setter
def license_check(self, value):
self._license_check = value
async def _library_check(self):
"""
Checks for missing shared library dependencies in the IOU image.
@@ -379,11 +390,18 @@ class IOUVM(BaseNode):
"""
Checks for a valid IOU key in the iourc file (paranoid mode).
"""
# license check is sent by the controller
if self.license_check is False:
return
try:
license_check = self._config().getboolean("license_check", True)
# we allow license check to be disabled server wide
server_wide_license_check = self._config().getboolean("license_check", True)
except ValueError:
raise IOUError("Invalid licence check setting")
if license_check is False:
if server_wide_license_check is False:
return
config = configparser.ConfigParser()