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

Fix if the route table changed to none #49533

Merged
merged 2 commits into from
Dec 10, 2018
Merged

Conversation

yuwzho
Copy link
Contributor

@yuwzho yuwzho commented Dec 5, 2018

SUMMARY

Fixes #49419

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
2.7.0

@ansibot
Copy link
Contributor

ansibot commented Dec 5, 2018

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 azure bug This issue/PR relates to a bug. cloud 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. owner_pr This PR is made by the module's maintainer. small_patch support:community This issue/PR relates to code supported by the Ansible community. labels Dec 5, 2018
@gundalow
Copy link
Contributor

gundalow commented Dec 5, 2018

@jerrynn @Fred-sun could you please test this PR and confirm if it fixes your issue in #49419

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Dec 5, 2018
@Fred-sun
Copy link
Contributor

Fred-sun commented Dec 5, 2018

@gundalow I have tried but fail, fail info same with report. Thanks!
@yuwzho could you help recheck it? Thanks!

fatal: [localhost]: FAILED! => {
    "changed": false, 
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/fred/.ansible/tmp/ansible-tmp-1544006820.25-276246544239643/AnsiballZ_azure_rm_subnet.py\", line 113, in <module>\n    _ansiballz_main()\n  File \"/home/fred/.ansible/tmp/ansible-tmp-1544006820.25-276246544239643/AnsiballZ_azure_rm_subnet.py\", line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/fred/.ansible/tmp/ansible-tmp-1544006820.25-276246544239643/AnsiballZ_azure_rm_subnet.py\", line 48, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_azure_rm_subnet_payload_TL_IYA/__main__.py\", line 386, in <module>\n  File \"/tmp/ansible_azure_rm_subnet_payload_TL_IYA/__main__.py\", line 382, in main\n  File \"/tmp/ansible_azure_rm_subnet_payload_TL_IYA/__main__.py\", line 228, in __init__\n  File \"/tmp/ansible_azure_rm_subnet_payload_TL_IYA/ansible_azure_rm_subnet_payload.zip/ansible/module_utils/azure_rm_common.py\", line 310, in __init__\n  File \"/tmp/ansible_azure_rm_subnet_payload_TL_IYA/__main__.py\", line 279, in exec_module\nUnboundLocalError: local variable 'route_table' referenced before assignment\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 
    "rc": 1
}
	to retry, use: --limit @/home/fred/task/49419/1.retry

@yuwzho
Copy link
Contributor Author

yuwzho commented Dec 7, 2018

@Fred-sun Please re-test

@Fred-sun
Copy link
Contributor

Fred-sun commented Dec 7, 2018

Thanks yuwzhou, I have tested and got success result, Please review the test result.
@gundalow Please help re-review this and push for merged. Thanks!

TASK [Create subnet with router table] ***************************************************************************
changed: [localhost]

TASK [debug] *****************************************************************************************************
ok: [localhost] => {
    "output01": {
        "changed": true, 
        "failed": false, 
        "state": {
            "address_prefix": "10.0.1.0/24", 
            "id": "/subscriptions/2085065b-00f8-4cba-9675-ba15f4d4ab66/resourceGroups/myRG04/providers/Microsoft.Network/virtualNetworks/mynetwork01/subnets/mysubnet01", 
            "name": "mysubnet01", 
            "network_security_group": {
                "id": "/subscriptions/2085065b-00f8-4cba-9675-ba15f4d4ab66/resourceGroups/cleanupservice/providers/Microsoft.Network/networkSecurityGroups/rg-cleanupservice-nsg123", 
                "name": "rg-cleanupservice-nsg123", 
                "resource_group": "cleanupservice"
            }, 
            "provisioning_state": "Succeeded", 
            "route_table": {
                "id": "/subscriptions/2085065b-00f8-4cba-9675-ba15f4d4ab66/resourceGroups/myRG04/providers/Microsoft.Network/routeTables/foobar", 
                "name": "foobar", 
                "resource_group": "myRG04"
            }
        }
    }
}

TASK [update the subnet without router table] ********************************************************************
changed: [localhost]

TASK [debug] *****************************************************************************************************
ok: [localhost] => {
    "output": {
        "changed": true, 
        "failed": false, 
        "state": {
            "address_prefix": "10.0.1.0/24", 
            "id": "/subscriptions/2085065b-00f8-4cba-9675-ba15f4d4ab66/resourceGroups/myRG04/providers/Microsoft.Network/virtualNetworks/mynetwork01/subnets/mysubnet01", 
            "name": "mysubnet01", 
            "network_security_group": {
                "id": "/subscriptions/2085065b-00f8-4cba-9675-ba15f4d4ab66/resourceGroups/cleanupservice/providers/Microsoft.Network/networkSecurityGroups/rg-cleanupservice-nsg123", 
                "name": "rg-cleanupservice-nsg123", 
                "resource_group": "cleanupservice"
            }, 
            "provisioning_state": "Succeeded", 
            "route_table": {}
        }
    }
}

PLAY RECAP *******************************************************************************************************
localhost                  : ok=8    changed=2    unreachable=0    failed=0    skipped=0 

@zikalino zikalino merged commit 5a59748 into ansible:devel Dec 10, 2018
@zikalino zikalino deleted the yuwzho-subnet branch December 10, 2018 02:30
yuwzho added a commit to VSChina/ansible that referenced this pull request Dec 10, 2018
abadger pushed a commit that referenced this pull request Dec 10, 2018
* Fix if the route table changed to none (#49533)

(cherry picked from commit 5a59748)

* add changelog
kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 azure bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. owner_pr This PR is made by the module's maintainer. 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.

azure_rm_subnet fails when existing subnet had route_table
5 participants