Selaa lähdekoodia

state: peer_present: shorten source lines

tags/v0.9
Maximilian Eschenbacher 6 vuotta sitten
vanhempi
commit
433689ebc1
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. +4
    -3
      _states/wireguard.py

+ 4
- 3
_states/wireguard.py Näytä tiedosto

ret['result'] = True ret['result'] = True
return ret return ret


if show.get('endpoint') != None and endpoint and show.get('endpoint') != endpoint:
if show.get('endpoint') and endpoint and show.get('endpoint') != endpoint:
__salt__['wg.set'](interface, peer=name, endpoint=endpoint) __salt__['wg.set'](interface, peer=name, endpoint=endpoint)
ret['changes']['endpoint'] = dict(old=show.get('endpoint'), new=endpoint)
ret['changes']['endpoint'] = dict(
old=show.get('endpoint'), new=endpoint)


if persistent_keepalive and show.get('persistent keepalive', None).startswith('every %s second' % (persistent_keepalive,)):
if persistent_keepalive and show.get('persistent keepalive', '').startswith('every %s second' % (persistent_keepalive,)):
__salt__['wg.set'](interface, peer=name, __salt__['wg.set'](interface, peer=name,
persistent_keepalive=persistent_keepalive) persistent_keepalive=persistent_keepalive)
ret['changes']['persistent keepalive'] = 'persistent keepalive changed.' ret['changes']['persistent keepalive'] = 'persistent keepalive changed.'

Loading…
Peruuta
Tallenna