Skip to content

Commit

Permalink
CP-49680: Support unquoted values in /etc/xensource-inventory
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Kaindl <[email protected]>
  • Loading branch information
bernhardkaindl committed Jun 6, 2024
1 parent fca707e commit 1c8d544
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/integration/dom0-template/etc/xensource-inventory
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ INSTALLATION_UUID='58d847c4-da26-4d48-a47e-0f4d8db53f52'
PRODUCT_VERSION_TEXT_SHORT='8 Cloud'
BRAND_CONSOLE='XenCenter'
PRODUCT_NAME='xenenterprise'
MANAGEMENT_INTERFACE='xenbr0'
COMPANY_PRODUCT_BRAND='XenServer'
CP49680_NOTE='Test xen-bugtool to tolerate empty and unquoted values'
MANAGEMENT_INTERFACE=
COMPANY_PRODUCT_BRAND=XenServer
PLATFORM_VERSION='3.3.0'
BUILD_NUMBER='cloud'
PLATFORM_NAME='XCP'
Expand Down
4 changes: 1 addition & 3 deletions xen-bugtool
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ def pidof(name):
return pids


def readKeyValueFile(filename, allowed_keys = None, strip_quotes = True, assert_quotes = True):
def readKeyValueFile(filename, allowed_keys = None, strip_quotes = True):
""" Reads a KEY=Value style file (e.g. xensource-inventory). Returns a
dictionary of key/values in the file. Not designed for use with large files
as the file is read entirely into memory."""
Expand All @@ -2375,8 +2375,6 @@ def readKeyValueFile(filename, allowed_keys = None, strip_quotes = True, assert_

if strip_quotes:
def quotestrip(x):
if assert_quotes:
assert x.startswith("'") and x.endswith("'")
return x.strip("'")
defs = [ (a, quotestrip(b)) for (a,b) in defs ]

Expand Down

0 comments on commit 1c8d544

Please sign in to comment.