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

Arch linux does not have osrelease or osmajorrelease grains #34453

Merged
merged 1 commit into from
Jul 5, 2016

Conversation

justinta
Copy link

@justinta justinta commented Jul 5, 2016

What does this PR do?

Arch linux does not have release versions, so it does not have the osrelease/osmajorrelease grains for it. This change accounts for the release grains not existing.

What issues does this PR fix or reference?

Fixes failing tests on Arch.

Tests written?

Yes

if os == 'Arch' and grain in ['osmajorrelease', 'osrelease']:
self.assertEqual(get_grain, '')
continue
self.assertTrue(get_grain)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why you removed the helper message from the assert above? (grain + " is not available")

Copy link
Author

Choose a reason for hiding this comment

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

Because when the grain doesn't exist it doesn't return that message. it just returns empty.

salt-call --local grains.item osmajorrelease
local:
    ----------
    osmajorrelease:
salt --versions-report
Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: 1.7.0
       cherrypy: 3.8.0
       dateutil: 2.4.2
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: 1.5.0
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: 1.4.4
       M2Crypto: 0.24.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: 1.2.5
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.11 (default, Mar 31 2016, 06:18:34)
   python-gnupg: 0.3.7
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: 0.6.5
          smmap: 0.9.0
        timelib: 0.2.4
        Tornado: 4.3
            ZMQ: 4.1.4

System Versions:
           dist:
        machine: x86_64
        release: 4.1.3
         system: Linux
        version: Not Installed

Copy link
Author

Choose a reason for hiding this comment

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

example non-existent grain

salt-call --local grains.item fakegrainitem
local:
    ----------
    fakegrainitem:

@rallytime rallytime merged commit 0460edb into saltstack:2016.3 Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants