require vs require_in in not-list yamlsyntax: differences, still on #8235

This commit is contained in:
regilero 2013-11-25 12:58:59 +01:00
parent 58bfbff843
commit 38bd6709f0
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,15 @@
A:
cmd.run:
- name: echo A
B:
cmd.run:
- name: echo B
# here used without "-"
- require:
cmd: A
C:
cmd.run:
- name: echo C
# here used without "-"
- require_in:
cmd: A

View File

@ -537,12 +537,24 @@ fi
'result':descr['result']
}
self.assertEqual(expected_result, result)
ret = self.run_function('state.sls', mods='requisites.require_error1')
self.assertEqual(ret, [
'Cannot extend ID W in "base:requisites.require_error1".'
+ ' It is not part of the high state.'
])
# issue #8235
# FIXME: Why is require enforcing list syntax while require_in does not?
# And why preventing it?
# Currently this state fails, should return C/B/A
result={}
ret = self.run_function('state.sls', mods='requisites.require_simple_nolist')
self.assertEqual(ret, [
'The require or watch statement in state "B" in sls '
+ '"requisites.require_simple_nolist" needs to be formed as a list'
])
# commented until a fix is made for issue #8772
# TODO: this test actually fails
#ret = self.run_function('state.sls', mods='requisites.require_error2')
@ -584,7 +596,7 @@ fi
'result':descr['result']
}
self.assertEqual(expected_result, result)
# TODO: not done
#ret = self.run_function('state.sls', mods='requisites.fullsls_require_in')
#self.assertEqual(['sls command can only be used with require requisite'], ret)