Skip to content

Commit

Permalink
Merge pull request #290 from martin-belanger/v1.1.8
Browse files Browse the repository at this point in the history
Avahi: Allow uppercase/lowercase "NQN/nqn" key in TXT field
  • Loading branch information
martin-belanger authored Dec 2, 2022
2 parents 0c6d592 + 5ad5fc6 commit cfffc69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# STorage Appliance Services (STAS)

## Changes with release 1.1.8

- Fix handling of TXT field containing NQN specified with lowercase "nqn" key. TP8009 says that the key for the Discovery Controller's NQN should be specified with the lowercase string "nqn". However, some DC may send an uppercase "NQN". nvme-stas will now support either uppercase "NQN" or lowercase "nqn".

## Changes with release 1.1.7

- Trim white spaces from Discovery Log Pages Entries (DLPE) and Configuration parameters.
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project(
'nvme-stas',
meson_version: '>= 0.53.0',
version: '1.1.7',
version: '1.1.8',
license: 'Apache-2.0',
default_options: [
'buildtype=release',
Expand Down
4 changes: 2 additions & 2 deletions staslib/avahi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _txt2dict(txt: list):
try:
string = functools.reduce(lambda accumulator, c: accumulator + chr(c), list_of_chars, '')
key, val = string.split("=")
the_dict[key] = val
the_dict[key.lower()] = val
except Exception: # pylint: disable=broad-except
pass

Expand Down Expand Up @@ -412,7 +412,7 @@ def _service_identified(
'traddr': address.strip(),
'trsvcid': str(port).strip(),
'host-iface': socket.if_indextoname(interface).strip(),
'subsysnqn': txt.get('NQN', defs.WELL_KNOWN_DISC_NQN).strip()
'subsysnqn': txt.get('nqn', defs.WELL_KNOWN_DISC_NQN).strip()
if conf.NvmeOptions().discovery_supp
else defs.WELL_KNOWN_DISC_NQN,
}
Expand Down

0 comments on commit cfffc69

Please sign in to comment.