Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias key in bolt inventory show --detail only shows alias from rightmost target definition #1379

Closed
lucywyman opened this issue Nov 5, 2019 · 1 comment
Assignees
Labels
Bug Bug reports and fixes.

Comments

@lucywyman
Copy link
Contributor

Describe the Bug

If a target is defined multiple times with different aliases in an inventoryfile, the aliases are merged and the target can be run using any alias (https://github.com/puppetlabs/bolt/blob/master/lib/bolt/inventory/group2.rb#L416). However when printing the target, regardless of which alias is used, only the alias defined in the rightmost definition will be printed.

---
version: 2
groups:
  - name: foo 
    targets:
      - name: localhost
        alias:
          - printed
          - boop
  - name: bar 
    targets:
      - name: localhost
        alias: also_printed

Expected Behavior

The --detail output should list aliases from all groups a target is a member of.

Steps to Reproduce

For example with this inventory, bolt inventory show --detail will output the same result for -n all, -n localhost, -n printed, -n boop, and -n also_printed, which is:

  "targets": [
    {
      "name": "localhost",
      "uri": null,
      "alias": "also_printed",
...
@lucywyman lucywyman added the Bug Bug reports and fixes. label Nov 5, 2019
@lucywyman lucywyman added this to 📝To Do in DEPRECATED: old Bolt Kanban via automation Nov 5, 2019
@beechtom beechtom moved this from 📝To Do to ⚡️Doing in DEPRECATED: old Bolt Kanban Nov 12, 2019
@beechtom beechtom self-assigned this Nov 12, 2019
beechtom added a commit to beechtom/bolt that referenced this issue Nov 12, 2019
…-detail

This commit fixes a bug where `inventory show --detail` only showed the
right-most alias for a target. Now, all aliases for a given target will
be displayed in the output.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 12, 2019
…-detail

This commit fixes a bug where `inventory show --detail` only showed the
rightmost alias for a target. Now, all aliases for a given target will
be displayed in the output.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 12, 2019
…-detail

This commit fixes a bug where `inventory show --detail` only showed the
rightmost alias for a target. Now, all aliases for a given target will
be displayed in the output.
@beechtom beechtom moved this from ⚡️Doing to 🚧 Reviewing in DEPRECATED: old Bolt Kanban Nov 13, 2019
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
…-detail

This commit fixes a bug where `inventory show --detail` only showed the
rightmost alias for a target. Now, all aliases for a given target will
be displayed in the output.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
…-detail

This commit fixes a bug where `inventory show --detail` only showed the
rightmost alias for a target. Now, all aliases for a given target will
be displayed in the output.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 13, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 14, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
beechtom added a commit to beechtom/bolt that referenced this issue Nov 15, 2019
This fixes a bug that caused `inventory show --detail` to only show the
rightmost alias for a given target. Previously, when the target data
hash was being merged during target lookup, aliases would be overridden
during each merge. Now, aliases are collected and combined into a single
array during the lookup process.
donoghuc added a commit that referenced this issue Nov 15, 2019
(GH-1379) Show all aliases for a target in inventory show --detail
@donoghuc
Copy link
Member

Closed by #1412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug reports and fixes.
Projects
No open projects
Development

No branches or pull requests

3 participants