Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- '''
- primary_ipv4
- '''
- from __future__ import absolute_import
- import subprocess
- def primary_ipv4():
- '''
- Return primary_ipv4
- '''
- grain = {}
- grain['primary_ipv4'] = subprocess.check_output("ip route get 1 | awk '{ print $7 }' | head -1", shell=True).rstrip()
- return grain
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement