Merge pull request #13794 from sandbender/extra_filerefs

Adds support for extra_filerefs=salt://path1,salt://path2 CLI arg to inc...
This commit is contained in:
Thomas S Hatch 2014-06-27 09:39:15 -06:00
commit 16ec2f03b2
2 changed files with 12 additions and 6 deletions

View File

@ -70,7 +70,7 @@ class SSHHighState(salt.state.BaseHighState):
return return
def lowstate_file_refs(chunks): def lowstate_file_refs(chunks, extras=''):
''' '''
Create a list of file ref objects to reconcile Create a list of file ref objects to reconcile
''' '''
@ -90,6 +90,12 @@ def lowstate_file_refs(chunks):
if saltenv not in refs: if saltenv not in refs:
refs[saltenv] = [] refs[saltenv] = []
refs[saltenv].append(crefs) refs[saltenv].append(crefs)
if extras:
extra_refs = extras.split(',')
if extra_refs:
for env in refs:
[refs[env].append([x]) for x in extra_refs]
return refs return refs

View File

@ -61,7 +61,7 @@ def sls(mods, saltenv='base', test=None, exclude=None, env=None, **kwargs):
return errors return errors
# Compile and verify the raw chunks # Compile and verify the raw chunks
chunks = st_.state.compile_high_data(high_data) chunks = st_.state.compile_high_data(high_data)
file_refs = salt.client.ssh.state.lowstate_file_refs(chunks) file_refs = salt.client.ssh.state.lowstate_file_refs(chunks, kwargs.get('extra_filerefs', ''))
trans_tar = salt.client.ssh.state.prep_trans_tar( trans_tar = salt.client.ssh.state.prep_trans_tar(
__opts__, __opts__,
chunks, chunks,
@ -100,7 +100,7 @@ def low(data):
err = st_.verify_data(data) err = st_.verify_data(data)
if err: if err:
return err return err
file_refs = salt.client.ssh.state.lowstate_file_refs(chunks) file_refs = salt.client.ssh.state.lowstate_file_refs(chunks, kwargs.get('extra_filerefs', ''))
trans_tar = salt.client.ssh.state.prep_trans_tar( trans_tar = salt.client.ssh.state.prep_trans_tar(
__opts__, __opts__,
chunks, chunks,
@ -135,7 +135,7 @@ def high(data):
__opts__['grains'] = __grains__ __opts__['grains'] = __grains__
st_ = salt.client.ssh.state.SSHHighState(__opts__, __pillar__, __salt__) st_ = salt.client.ssh.state.SSHHighState(__opts__, __pillar__, __salt__)
chunks = st_.state.compile_high_data(high) chunks = st_.state.compile_high_data(high)
file_refs = salt.client.ssh.state.lowstate_file_refs(chunks) file_refs = salt.client.ssh.state.lowstate_file_refs(chunks, kwargs.get('extra_filerefs', ''))
trans_tar = salt.client.ssh.state.prep_trans_tar( trans_tar = salt.client.ssh.state.prep_trans_tar(
__opts__, __opts__,
chunks, chunks,
@ -172,7 +172,7 @@ def highstate(test=None, **kwargs):
__opts__['grains'] = __grains__ __opts__['grains'] = __grains__
st_ = salt.client.ssh.state.SSHHighState(__opts__, __pillar__, __salt__) st_ = salt.client.ssh.state.SSHHighState(__opts__, __pillar__, __salt__)
chunks = st_.compile_low_chunks() chunks = st_.compile_low_chunks()
file_refs = salt.client.ssh.state.lowstate_file_refs(chunks) file_refs = salt.client.ssh.state.lowstate_file_refs(chunks, kwargs.get('extra_filerefs', ''))
trans_tar = salt.client.ssh.state.prep_trans_tar( trans_tar = salt.client.ssh.state.prep_trans_tar(
__opts__, __opts__,
chunks, chunks,
@ -219,7 +219,7 @@ def top(topfn, test=None, **kwargs):
st_ = salt.client.ssh.state.SSHHighState(__opts__, __pillar__, __salt__) st_ = salt.client.ssh.state.SSHHighState(__opts__, __pillar__, __salt__)
st_.opts['state_top'] = os.path.join('salt://', topfn) st_.opts['state_top'] = os.path.join('salt://', topfn)
chunks = st_.compile_low_chunks() chunks = st_.compile_low_chunks()
file_refs = salt.client.ssh.state.lowstate_file_refs(chunks) file_refs = salt.client.ssh.state.lowstate_file_refs(chunks, kwargs.get('extra_filerefs', ''))
trans_tar = salt.client.ssh.state.prep_trans_tar( trans_tar = salt.client.ssh.state.prep_trans_tar(
__opts__, __opts__,
chunks, chunks,