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

ce_startup: update to fix a bug #59346

Merged
merged 1 commit into from
Jul 24, 2019
Merged

ce_startup: update to fix a bug #59346

merged 1 commit into from
Jul 24, 2019

Conversation

yuandongx
Copy link
Contributor

@yuandongx yuandongx commented Jul 21, 2019

SUMMARY
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/network/cloudengine/ce_startup.py

ADDITIONAL INFORMATION

test case

  - name: "Step2.1.1 test the correct cfg_file"
    ce_startup:
      cfg_file: 111_back.cfg
      slot: 1

error log

changed: [10.190.121.125] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "end_state": {
        "StartupInfos": null
    },
    "existing": {
        "StartupInfos": [
            {
                "configSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "curentPatchFile": "NULL",
                "curentStartupFile": "flash:/111.cfg",
                "curentSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "nextPatchFile": "NULL",
                "nextStartupFile": "flash:/111.cfg",
                "nextSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "position": "slot1"
            }
        ]
    },
    "invocation": {
        "module_args": {
            "action": null,
            "cfg_file": "111_back.cfg",
            "host": "10.190.121.125",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "patch_file": null,
            "port": 10111,
            "provider": {
                "host": "10.190.121.125",
                "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "port": 10111,
                "ssh_keyfile": null,
                "timeout": null,
                "transport": "cli",
                "use_ssl": null,
                "username": "huawei",
                "validate_certs": null
            },
            "slot": "1",
            "software_file": null,
            "ssh_keyfile": null,
            "timeout": null,
            "transport": "cli",
            "use_ssl": null,
            "username": "huawei",
            "validate_certs": null
        }
    },
    "proposed": {
        "cfg_file": "111_back.cfg",
        "slot": "1"
    },
    "updates": [
        "startup saved-configuration 111_back.cfg slot 1"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ****************************************************************************************************
10.190.121.125             : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

in facts, it does work as expect.

display startup, but configure is not set up.

<8850_130.12>dis startup
MainBoard:
  Configured startup system software:        flash:/CE8850EI-V200R019C10.cc
  Startup system software:                   flash:/CE8850EI-V200R019C10.cc
  Next startup system software:              flash:/CE8850EI-V200R019C10.cc
  Startup saved-configuration file:          flash:/111.cfg
  Next startup saved-configuration file:     flash:/111.cfg
  Startup paf file:                          default
  Next startup paf file:                     default
  Startup patch package:                     NULL
  Next startup patch package:                NULL
<8850_130.12>

The reason is that netconf and cli are all used to load configure,
But it loads xml configure via cli somtimes, there would be error.
So changed it.

after changed, test log.

changed: [10.190.121.125] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "end_state": {
        "StartupInfos": [
            {
                "configSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "curentPatchFile": "NULL",
                "curentStartupFile": "flash:/111.cfg",
                "curentSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "nextPatchFile": "NULL",
                "nextStartupFile": "flash:/111_back.cfg",
                "nextSysSoft": "flash:/CE8850EI-V200R019C10_back.cc",
                "postion": "MainBoard:"
            }
        ]
    },
    "existing": {
        "StartupInfos": [
            {
                "configSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "curentPatchFile": "NULL",
                "curentStartupFile": "flash:/111.cfg",
                "curentSysSoft": "flash:/CE8850EI-V200R019C10.cc",
                "nextPatchFile": "NULL",
                "nextStartupFile": "flash:/111.cfg",
                "nextSysSoft": "flash:/CE8850EI-V200R019C10_back.cc",
                "postion": "MainBoard:"
            }
        ]
    },
    "invocation": {
        "module_args": {
            "action": null,
            "cfg_file": "flash:/111_back.cfg",
            "host": "10.190.121.125",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "patch_file": null,
            "port": 10111,
            "provider": {
                "host": "10.190.121.125",
                "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "port": 10111,
                "ssh_keyfile": null,
                "timeout": null,
                "transport": "cli",
                "use_ssl": null,
                "username": "huawei",
                "validate_certs": null
            },
            "slot": "1",
            "software_file": null,
            "ssh_keyfile": null,
            "timeout": null,
            "transport": "cli",
            "use_ssl": null,
            "username": "huawei",
            "validate_certs": null
        }
    },
    "proposed": {
        "cfg_file": "flash:/111_back.cfg",
        "slot": "1"
    },
    "updates": [
        "startup saved-configuration flash:/111_back.cfg slot 1"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP **************************************************************************
10.190.121.125             : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

display startup on device

<8850_130.12>display startup
MainBoard:
  Configured startup system software:        flash:/CE8850EI-V200R019C10.cc
  Startup system software:                   flash:/CE8850EI-V200R019C10.cc
  Next startup system software:              flash:/CE8850EI-V200R019C10_back.cc
  Startup saved-configuration file:          flash:/111.cfg
  Next startup saved-configuration file:     flash:/111_back.cfg
  Startup paf file:                          default
  Next startup paf file:                     default
  Startup patch package:                     NULL
  Next startup patch package:                NULL
<8850_130.12>


@ansibot
Copy link
Contributor

ansibot commented Jul 21, 2019

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category owner_pr This PR is made by the module's maintainer. support:community This issue/PR relates to code supported by the Ansible community. labels Jul 21, 2019
@yuandongx yuandongx marked this pull request as ready for review July 21, 2019 06:09
@yuandongxx
Copy link
Contributor

shipit

@ansibot ansibot added automerge This PR was automatically merged by ansibot. shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. labels Jul 24, 2019
@yuandongx
Copy link
Contributor Author

bot_status

@ansibot ansibot merged commit 6ff54c5 into ansible:devel Jul 24, 2019
abadger pushed a commit that referenced this pull request Jul 29, 2019
* update to fix a bug (#59346)


(cherry picked from commit 6ff54c5)

* add a changelog fragment.
@ansible ansible locked and limited conversation to collaborators Aug 21, 2019
@yuandongx yuandongx deleted the bug/ce_startup/20190721 branch September 26, 2019 06:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 automerge This PR was automatically merged by ansibot. bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category owner_pr This PR is made by the module's maintainer. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants