Skip to content

Commit

Permalink
Merge pull request #52670 from dmurphy18/deprecat_ifupdown
Browse files Browse the repository at this point in the history
Replace deprecated ifup, ifdown iface with ip link set iface up, down
  • Loading branch information
garethgreenaway authored Apr 26, 2019
2 parents 94468ba + c8c7b09 commit c49ccae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions salt/modules/debian_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,8 @@ def down(iface, iface_type):
# Slave devices are controlled by the master.
# Source 'interfaces' aren't brought down.
if iface_type not in ['slave', 'source']:
return __salt__['cmd.run'](['ifdown', iface])
cmd = ['ip', 'link', 'set', '{0}'.format(iface), 'down']
return __salt__['cmd.run'](cmd, python_shell=False)
return None


Expand Down Expand Up @@ -1883,7 +1884,8 @@ def up(iface, iface_type): # pylint: disable=C0103
# Slave devices are controlled by the master.
# Source 'interfaces' aren't brought up.
if iface_type not in ('slave', 'source'):
return __salt__['cmd.run'](['ifup', iface])
cmd = ['ip', 'link', 'set', '{0}'.format(iface), 'up']
return __salt__['cmd.run'](cmd, python_shell=False)
return None


Expand Down

0 comments on commit c49ccae

Please sign in to comment.