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

ansible supports ZTE's Operating System os-release #54160

Closed
wants to merge 3 commits into from

Conversation

Sasocai
Copy link

@Sasocai Sasocai commented Mar 21, 2019

Signed-off-by: CaiJiYan cai.jiyan@zte.com.cn

SUMMARY
adds support for NewStart

ISSUE TYPE
Feature Pull Request

COMPONENT NAME
lib/ansible/module_utils/facts/system/distribution.py

Signed-off-by: CaiJiYan <cai.jiyan@zte.com.cn>
@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 21, 2019
Copy link
Contributor

@gundalow gundalow left a comment

Choose a reason for hiding this comment

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

Hi,
Thanks for adding support for ZTE to Ansibe's facts systems.

We have some unit tests for this in test/units/module_utils/test_distribution_version.py

You can run them locally by running the following command from your checkout
bin/ansible-test units -v --docker default test/units/module_utils/test_distribution_version.py

@ansibot
Copy link
Contributor

ansibot commented Mar 21, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/module_utils/facts/system/distribution.py:260:5: E303 too many blank lines (2)

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Mar 21, 2019
@ansibot
Copy link
Contributor

ansibot commented Mar 22, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/module_utils/facts/system/distribution.py:260:5: E303 too many blank lines (2)

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Mar 22, 2019
@Akasurde Akasurde self-assigned this Mar 22, 2019
del 259 blank line
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 25, 2019
@sivel sivel requested a review from samdoran April 2, 2019 20:48
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Apr 2, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 2, 2019
Copy link
Contributor

@samdoran samdoran left a comment

Choose a reason for hiding this comment

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

We also need an entry in OS_FAMILY_MAP in the Distribution class. Please add unit tests with example data from /etc/cgsl-release. Look at test/units/module_utils/test_distribution_version.py for examples. You can run hacking/tests/gen_distribution_version_testcase.py to generate test data.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Apr 3, 2019
entry in OS_FAMILY_MAP in the Distribution class add 'NewStart',
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 10, 2019
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Apr 18, 2019
@Sasocai
Copy link
Author

Sasocai commented Apr 29, 2019

test/units/module_utils/test_distribution_version.py add

TESTSETS = [
    {
        "platform.dist": [
            "",
            "",
            ""
        ],
        "input": {
            "/etc/cgsl-release": "NewStart Carrier Grade Server Linux Core release 5.05\n",
            "/etc/os-release": (
                "NAME=\"NewStart CGS Linux Core\"\nVERSION=\"5.05\"\nID=\"ZTEOS\"\nID_LIKE=\"centos rhel fedora\"\nVERSION_ID=\"5.05\"\n"
                "PRETTY_NAME=\"NewStart Carrier Grade Server Linux Core 5.05\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:centos:centos:7\"\n"
                "HOME_URL=\"https://www.gd-linux.com/\"\nBUG_REPORT_URL=\"https://www.gd-linux.com/\""
            ),
            "/etc/system-release": "NewStart Carrier Grade Server Linux Core release 5.05\n"
        },
        "name": "NewStart 5.05",
        "result": {
            "distribution_release": "Carrier Grade Server Linux Core",
            "distribution": "NewStart",
            "distribution_major_version": "5",
            "os_family": "RedHat",
            "distribution_version": "5.05",
        }
    },
gen_distribution_version_testcase.py add
filelist = [
    '/etc/cgsl-release',

run  gen_distribution_version_testcase.py
[root@localhost tests]# python gen_distribution_version_testcase.py
{
    "platform.dist": [
        "zteos",
        "5.05",
        ""
    ],
    "input": {
        "/etc/os-release": "NAME=\"NewStart CGS Linux Core\"\nVERSION=\"5.05\"\nID=\"ZTEOS\"\nID_LIKE=\"centos rhel fedora\"\nVERSION_ID=\"5.05\"\nPRETTY_NAME=\"NewStart Carrier Grade Server Linux Core 5.05\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:centos:centos:7\"\nHOME_URL=\"http://www.gd-linux.com/\"\nBUG_REPORT_URL=\"http://www.gd-linux.com/\"\n",
        "/etc/cgsl-release": "NewStart Carrier Grade Server Linux Core release 5.05 \n",
        "/etc/system-release": "NewStart Carrier Grade Server Linux Core release 5.05 \n"
    },
    "name": "NewStart 5.05",
    "result": {
        "distribution_release": "Carrier Grade Server Linux Core",
        "distribution": "NewStart",
        "distribution_major_version": "5",
        "os_family": "RedHat",
        "distribution_version": "5.05"
    }
}

gundalow: Edit to add code block formatting

@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jun 25, 2019
@ansibot ansibot added the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jul 3, 2019
@Akasurde
Copy link
Member

@Sasocai Are you still working on this, let us know ? Thanks, needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Nov 16, 2019
@ansibot
Copy link
Contributor

ansibot commented Dec 18, 2019

@Sasocai This pullrequest is waiting for your response. Please respond or the pullrequest will be closed.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jan 19, 2020

@Sasocai You have not responded to information requests in this pullrequest so we will assume it no longer affects you. If you are still interested in this, please create a new pullrequest with the requested information.

click here for bot help

@ansibot ansibot closed this Jan 19, 2020
@ansible ansible locked and limited conversation to collaborators Feb 17, 2020
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 feature This issue/PR relates to a feature request. needs_info This issue requires further information. Please answer any outstanding questions. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants