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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/integration/modules/grains.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ def test_get_core_grains(self):
test to ensure some core grains are returned
'''
grains = ['os', 'os_family', 'osmajorrelease', 'osrelease', 'osfullname', 'id']
os = self.run_function('grains.get', ['os'])

for grain in grains:
get_grain = self.run_function('grains.get', [grain])
self.assertTrue(get_grain, grain + "is not available")
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:



class GrainsAppendTestCase(integration.ModuleCase):
Expand Down