Browse Source

Deleting deprecated function and switch test to 2017.7

The patch deletes deprecated cmd.run function which actually
was defined in salt 2016 as alias for cmd.shell therefore this
change supports backward compatibility.

Change-Id: I47eae0b8ee45ca1a1a9b3e8e544c893614573fda
Related-PROD: 17056
pull/73/head
Oleh Hryhorov 7 years ago
parent
commit
7c5dfd3616
4 changed files with 17 additions and 6 deletions
  1. +1
    -1
      .kitchen.yml
  2. +11
    -0
      .travis.yml
  3. +4
    -4
      _modules/virtng.py
  4. +1
    -1
      salt/files/orchestrate.sls

+ 1
- 1
.kitchen.yml View File

@@ -8,7 +8,7 @@ provisioner:
name: salt_solo
salt_install: bootstrap
salt_bootstrap_url: https://bootstrap.saltstack.com
salt_version: latest
salt_version: <%=ENV['SALT_VERSION'] || 'latest'%>
salt_minion_id: salt.ci.local
require_chef: false
log_level: error

+ 11
- 0
.travis.yml View File

@@ -18,6 +18,17 @@ install:

env:

- PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=control-default
- PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=master-default
- PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=minion-default
- PLATFORM=trevorj/salty-whales:trusty-2017.7 SUITE=minion-multi-master-failover
- PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=control-default
- PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=master-default
- PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=minion-default
- PLATFORM=trevorj/salty-whales:xenial-2017.7 SUITE=minion-multi-master-failover
# TODO, once 18.04 LTS Bionic Beaver is released, rename trusty to bionic
- PLATFORM=trevorj/salty-whales:bionic-2017.7 SUITE=master-default
- PLATFORM=trevorj/salty-whales:bionic-2017.7 SUITE=minion-default
- PLATFORM=trevorj/salty-whales:trusty SUITE=control-default
- PLATFORM=trevorj/salty-whales:trusty SUITE=master-default
- PLATFORM=trevorj/salty-whales:trusty SUITE=minion-default

+ 4
- 4
_modules/virtng.py View File

@@ -313,7 +313,7 @@ def _qemu_image_info(path):
Detect information for the image at path
'''
ret = {}
out = __salt__['cmd.run']('qemu-img info {0}'.format(path))
out = __salt__['cmd.shell']('qemu-img info {0}'.format(path))

match_map = {'size': r'virtual size: \w+ \((\d+) byte[s]?\)',
'format': r'file format: (\w+)'}
@@ -332,7 +332,7 @@ def _image_type(vda):
'''
Detect what driver needs to be used for the given image
'''
out = __salt__['cmd.run']('qemu-img info {0}'.format(vda))
out = __salt__['cmd.shell']('qemu-img info {0}'.format(vda))
if 'file format: qcow2' in out:
return 'qcow2'
else:
@@ -1599,7 +1599,7 @@ def is_kvm_hyper():
except IOError:
# No /proc/modules? Are we on Windows? Or Solaris?
return False
return 'libvirtd' in __salt__['cmd.run'](__grains__['ps'])
return 'libvirtd' in __salt__['cmd.shell'](__grains__['ps'])


def is_xen_hyper():
@@ -1624,7 +1624,7 @@ def is_xen_hyper():
except IOError:
# No /proc/modules? Are we on Windows? Or Solaris?
return False
return 'libvirtd' in __salt__['cmd.run'](__grains__['ps'])
return 'libvirtd' in __salt__['cmd.shell'](__grains__['ps'])


def is_hyper():

+ 1
- 1
salt/files/orchestrate.sls View File

@@ -30,7 +30,7 @@ args: {{ args }}

{%- if salt['file.directory_exists']('/srv/salt/env/'+environment_name+'/'+formula.0+'/orchestrate') and formula|length > 1 and salt['file.file_exists']('/srv/salt/env/'+environment_name+'/'+formula.0+'/orchestrate/'+formula.1+'.sls') %}

{{ salt['cmd.run']('cat /srv/salt/env/'+environment_name+'/'+formula.0+'/orchestrate/'+formula.1+'.sls') }}
{{ salt['cmd.shell']('cat /srv/salt/env/'+environment_name+'/'+formula.0+'/orchestrate/'+formula.1+'.sls') }}

{%- else %}
{%- if args[ state.0 ] is defined %}

Loading…
Cancel
Save