diff --git a/changelogs/fragments/11179-mas-list-parsing.yml b/changelogs/fragments/11179-mas-list-parsing.yml new file mode 100644 index 0000000000..c5ee448792 --- /dev/null +++ b/changelogs/fragments/11179-mas-list-parsing.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - mas - parse CLI output correctly when listing installed apps with mas 3.0.0+ (https://github.com/ansible-collections/community.general/pull/11179). diff --git a/plugins/modules/mas.py b/plugins/modules/mas.py index 3659c97636..1dbf921764 100644 --- a/plugins/modules/mas.py +++ b/plugins/modules/mas.py @@ -201,8 +201,14 @@ class Mas(object): rows = [] apps = [] for r in rows: - # Format: "123456789 App Name" - r = r.split(' ', 1) + # mas 2.3.0 and older: + # 123456789 App Name (version) + # 4567890 App Name Longer (version) + # + # mas 3.0.0 and newer: + # 123456789 App Name (version) + # 4567890 App Name Longer (version) + r = r.strip().split(' ', 1) if len(r) == 2: apps.append(int(r[0]))