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

nmcli: fix error when setting previously unset mac address #5291

Merged
merged 4 commits into from
Sep 28, 2022
Merged

nmcli: fix error when setting previously unset mac address #5291

merged 4 commits into from
Sep 28, 2022

Conversation

giorgiga
Copy link
Contributor

SUMMARY

This adds an if to avoid errors when setting a mac address in an existing connections that didn't have it and does the same thing for two other parameters.

Fixes #5290

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nmcli

ADDITIONAL INFORMATION

N/A

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module net_tools new_contributor Help guide this first time contributor plugins plugin (any type) labels Sep 17, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Can you please add a changelog fragment? Thanks.

plugins/modules/net_tools/nmcli.py Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Sep 26, 2022
@giorgiga
Copy link
Contributor Author

Thanks for reviewing this PR @felixfontein.
I believe all suggestions have been accounted for.

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 and removed check-before-release PR will be looked at again shortly before release and merged if possible. labels Sep 28, 2022
@felixfontein felixfontein merged commit ec9e10d into ansible-collections:main Sep 28, 2022
@patchback
Copy link

patchback bot commented Sep 28, 2022

Backport to stable-4: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply ec9e10d on top of patchback/backports/stable-4/ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9/pr-5291

Backporting merged PR #5291 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.general.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4/ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9/pr-5291 upstream/stable-4
  4. Now, cherry-pick PR nmcli: fix error when setting previously unset mac address #5291 contents into that branch:
    $ git cherry-pick -x ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9
    If it'll yell at you with something like fatal: Commit ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR nmcli: fix error when setting previously unset mac address #5291 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4/ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9/pr-5291
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Sep 28, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/ec9e10d6d1dc83cb47bf30fb7fd14af65eccc6a9/pr-5291

Backported as #5318

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@giorgiga thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Sep 28, 2022
* fix #5290

* add changelog fragment

* remove unnecessary braces

* Update changelogs/fragments/5291-fix-nmcli-error-when-setting-unset-mac-address.yaml

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit ec9e10d)
@github-actions
Copy link

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

felixfontein pushed a commit that referenced this pull request Sep 28, 2022
…5318)

* fix #5290

* add changelog fragment

* remove unnecessary braces

* Update changelogs/fragments/5291-fix-nmcli-error-when-setting-unset-mac-address.yaml

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit ec9e10d)

Co-authored-by: Giorgio Gallo <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this pull request Sep 29, 2022
…ollections#5291)

* fix ansible-collections#5290

* add changelog fragment

* remove unnecessary braces

* Update changelogs/fragments/5291-fix-nmcli-error-when-setting-unset-mac-address.yaml

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
v1v added a commit to v1v/community.general that referenced this pull request Oct 7, 2022
* upstream/main: (203 commits)
  Make pfexec become usable for illumos (ansible-collections#3889)
  znode: add options for authentication (ansible-collections#5306)
  keycloak_user_federation: add explanation and example to vendor option (ansible-collections#4893)
  Next expected release is 5.8.0.
  Allow terraform module to specify complex variable structures (ansible-collections#4797)
  Fix ansible-collections#5313: redhat_subscription module is not idempotent when pool_ids (ansible-collections#5319)
  bitwarden: Add field to search for all item attributes, instead of on… (ansible-collections#5297)
  New Module: Keycloak User Rolemapping (ansible-collections#4898)
  chore: Update lxc_container to support py3 (ansible-collections#5304)
  terraform: run `init` with no-color, too (ansible-collections#5147)
  nmcli: fix error when setting previously unset mac address (ansible-collections#5291)
  [feat] proxmox_snap: snapshot containers with configured mountpoints (ansible-collections#5274)
  machinectl: include the success command (ansible-collections#5287)
  Add SetSessionService to redfish_config (ansible-collections#5009)
  locale_gen: fix UbuntuMode (ansible-collections#5282)
  ini_file: fix lint error (ansible-collections#5307)
  netcup_dnsapi: Add timeout paramter (ansible-collections#5301)
  stable-2.14 is now default.
  Add stable-2.14 to CI, adjust to devel version bump (ansible-collections#5298)
  Try to run reuse workflow without explicitly allowing it for new contributors. (ansible-collections#5296)
  ...
bratwurzt pushed a commit to bratwurzt/community.general that referenced this pull request Nov 7, 2022
…ollections#5291)

* fix ansible-collections#5290

* add changelog fragment

* remove unnecessary braces

* Update changelogs/fragments/5291-fix-nmcli-error-when-setting-unset-mac-address.yaml

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module net_tools new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nmcli error while adding mac to existing connection
3 participants