sls/xen/bridgeconfig.sls: add type cast in case num is an int.

This commit is contained in:
Antsiferov Grigory 2017-02-01 19:22:31 +03:00
parent 9b95ed95c0
commit 915f43069a

View File

@ -5,16 +5,17 @@ def mlchap(key, values):
changes.append(key + '="' + '''\n\t'''.join(values) + '"\n') changes.append(key + '="' + '''\n\t'''.join(values) + '"\n')
for br in __salt__['pillar.get']('xen:xenbrs', []): for br in __salt__['pillar.get']('xen:xenbrs', []):
mlchap('bridge_xenbr' + br['num'], br['ifaces']) num = str(br['num'])
mlchap('config_xenbr' + br['num'], (br['config'],)) mlchap('bridge_xenbr' + num, br['ifaces'])
mlchap('config_brctl' + br['num'], (br['brctl'],)) mlchap('config_xenbr' + num, (br['config'],))
mlchap('rc_net_xenbr' + br['num'] + '_provide', ('!net',)) mlchap('config_brctl' + num, (br['brctl'],))
mlchap('rc_net_xenbr' + br['num'] + '_need', (br['need'],)) mlchap('rc_net_xenbr' + num + '_provide', ('!net',))
mlchap('rc_xendomains_use', ('net.xenbr' + br['num'],)) mlchap('rc_net_xenbr' + num + '_need', (br['need'],))
state('/etc/init.d/net.xenbr' + br['num']).file.symlink(target='net.lo').\ mlchap('rc_xendomains_use', ('net.xenbr' + num,))
state('/etc/init.d/net.xenbr' + num).file.symlink(target='net.lo').\
require(file='set-xenbridges-conf') require(file='set-xenbridges-conf')
state('net.xenbr' + br['num']).service.running(enable=True).\ state('net.xenbr' + num).service.running(enable=True).\
require(file='/etc/init.d/net.xenbr' + br['num']) require(file='/etc/init.d/net.xenbr' + num)
state('set-xenbridges-conf').file.blockreplace( state('set-xenbridges-conf').file.blockreplace(
name='/etc/conf.d/net', name='/etc/conf.d/net',