Commit cabc869c authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Merge branch 'stable-2.9' into stable-2.10



* stable-2.9
  (no changes)

* stable-2.8
  Add all dependencies for confd as test dependencies
  Add snap-server to the test-relevenat packages
  Placate warnings on ganeti.outils_unittest.py
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parents 708f8301 a50b49b8
...@@ -614,8 +614,12 @@ AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1]) ...@@ -614,8 +614,12 @@ AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1])
# of the checks. # of the checks.
AC_GHC_PKG_CHECK([attoparsec], [], [HS_NODEV=1]) AC_GHC_PKG_CHECK([attoparsec], [], [HS_NODEV=1])
AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1]) AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1])
AC_GHC_PKG_CHECK([process], [], AC_GHC_PKG_CHECK([process], [], [HS_NODEV=1])
[MONITORING_PKG="$MONITORING_PKG process"]) AC_GHC_PKG_CHECK([snap-server], [], [HS_NODEV=1])
AC_GHC_PKG_CHECK([regex-pcre], [], [HS_NODEV=1])
AC_GHC_PKG_CHECK([Crypto], [], [HS_NODEV=1])
AC_GHC_PKG_CHECK([text], [], [HS_NODEV=1])
AC_GHC_PKG_CHECK([hinotify], [], [HS_NODEV=1])
if test -n "$HS_NODEV"; then if test -n "$HS_NODEV"; then
AC_MSG_WARN(m4_normalize([Required development modules were not found, AC_MSG_WARN(m4_normalize([Required development modules were not found,
you won't be able to run Haskell unittests])) you won't be able to run Haskell unittests]))
......
...@@ -328,7 +328,7 @@ class OVFReader(object): ...@@ -328,7 +328,7 @@ class OVFReader(object):
schema fragment removed or empty dictionary, when root is None schema fragment removed or empty dictionary, when root is None
""" """
if not root: if root is None:
return {} return {}
results = {} results = {}
for element in list(root): for element in list(root):
...@@ -398,7 +398,7 @@ class OVFReader(object): ...@@ -398,7 +398,7 @@ class OVFReader(object):
hypervisor_search = ("{%s}GanetiSection/{%s}Hypervisor" % hypervisor_search = ("{%s}GanetiSection/{%s}Hypervisor" %
(GANETI_SCHEMA, GANETI_SCHEMA)) (GANETI_SCHEMA, GANETI_SCHEMA))
hypervisor_data = self.tree.find(hypervisor_search) hypervisor_data = self.tree.find(hypervisor_search)
if not hypervisor_data: if hypervisor_data is None:
return {"hypervisor_name": constants.VALUE_AUTO} return {"hypervisor_name": constants.VALUE_AUTO}
results = { results = {
"hypervisor_name": hypervisor_data.findtext("{%s}Name" % GANETI_SCHEMA, "hypervisor_name": hypervisor_data.findtext("{%s}Name" % GANETI_SCHEMA,
...@@ -419,7 +419,7 @@ class OVFReader(object): ...@@ -419,7 +419,7 @@ class OVFReader(object):
os_search = ("{%s}GanetiSection/{%s}OperatingSystem" % os_search = ("{%s}GanetiSection/{%s}OperatingSystem" %
(GANETI_SCHEMA, GANETI_SCHEMA)) (GANETI_SCHEMA, GANETI_SCHEMA))
os_data = self.tree.find(os_search) os_data = self.tree.find(os_search)
if os_data: if os_data is not None:
results["os_name"] = os_data.findtext("{%s}Name" % GANETI_SCHEMA) results["os_name"] = os_data.findtext("{%s}Name" % GANETI_SCHEMA)
parameters = os_data.find("{%s}Parameters" % GANETI_SCHEMA) parameters = os_data.find("{%s}Parameters" % GANETI_SCHEMA)
results.update(self._GetDictParameters(parameters, GANETI_SCHEMA)) results.update(self._GetDictParameters(parameters, GANETI_SCHEMA))
...@@ -439,7 +439,7 @@ class OVFReader(object): ...@@ -439,7 +439,7 @@ class OVFReader(object):
(OVF_SCHEMA, OVF_SCHEMA, OVF_SCHEMA)) (OVF_SCHEMA, OVF_SCHEMA, OVF_SCHEMA))
match_vcpus = ("{%s}ResourceType" % RASD_SCHEMA, RASD_TYPE["vcpus"]) match_vcpus = ("{%s}ResourceType" % RASD_SCHEMA, RASD_TYPE["vcpus"])
vcpus = self._GetElementMatchingText(find_vcpus, match_vcpus) vcpus = self._GetElementMatchingText(find_vcpus, match_vcpus)
if vcpus: if vcpus is not None:
vcpus_count = vcpus.findtext("{%s}VirtualQuantity" % RASD_SCHEMA, vcpus_count = vcpus.findtext("{%s}VirtualQuantity" % RASD_SCHEMA,
default=constants.VALUE_AUTO) default=constants.VALUE_AUTO)
else: else:
...@@ -450,7 +450,7 @@ class OVFReader(object): ...@@ -450,7 +450,7 @@ class OVFReader(object):
match_memory = ("{%s}ResourceType" % RASD_SCHEMA, RASD_TYPE["memory"]) match_memory = ("{%s}ResourceType" % RASD_SCHEMA, RASD_TYPE["memory"])
memory = self._GetElementMatchingText(find_memory, match_memory) memory = self._GetElementMatchingText(find_memory, match_memory)
memory_raw = None memory_raw = None
if memory: if memory is not None:
alloc_units = memory.findtext("{%s}AllocationUnits" % RASD_SCHEMA) alloc_units = memory.findtext("{%s}AllocationUnits" % RASD_SCHEMA)
matching_units = [units for units, variants in ALLOCATION_UNITS.items() matching_units = [units for units, variants in ALLOCATION_UNITS.items()
if alloc_units.lower() in variants] if alloc_units.lower() in variants]
...@@ -528,7 +528,7 @@ class OVFReader(object): ...@@ -528,7 +528,7 @@ class OVFReader(object):
ganeti_match) ganeti_match)
ganeti_data = {} ganeti_data = {}
if network_ganeti_data: if network_ganeti_data is not None:
ganeti_data["mode"] = network_ganeti_data.findtext("{%s}Mode" % ganeti_data["mode"] = network_ganeti_data.findtext("{%s}Mode" %
GANETI_SCHEMA) GANETI_SCHEMA)
ganeti_data["mac"] = network_ganeti_data.findtext("{%s}MACAddress" % ganeti_data["mac"] = network_ganeti_data.findtext("{%s}MACAddress" %
...@@ -540,7 +540,7 @@ class OVFReader(object): ...@@ -540,7 +540,7 @@ class OVFReader(object):
ganeti_data["network"] = network_ganeti_data.findtext("{%s}Net" % ganeti_data["network"] = network_ganeti_data.findtext("{%s}Net" %
GANETI_SCHEMA) GANETI_SCHEMA)
mac_data = None mac_data = None
if network_data: if network_data is not None:
mac_data = network_data.findtext("{%s}Address" % RASD_SCHEMA) mac_data = network_data.findtext("{%s}Address" % RASD_SCHEMA)
network_name = network_name.lower() network_name = network_name.lower()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment