Skip to content

Commit

Permalink
Replacing ifconfig with ip addr
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin Agarwal committed Feb 27, 2015
1 parent 6155499 commit 289999c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# # Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--cpus", "1"]
end
#
# View the documentation for the provider you're using for more
Expand Down
5 changes: 3 additions & 2 deletions ssddj/globalstatemanager/gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ def GetInterfaces(self):
"""
Scan and get network interfaces into saturnring DB
"""
cmdStr = 'ifconfig | grep -oE "inet addr:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | cut -d: -f2'
#cmdStr = 'ifconfig | grep -oE "inet addr:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | cut -d: -f2'
cmdStr = 'ip addr | grep -oE "inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | cut -d" " -f2'
ipadds=self.Exec(cmdStr)
if ipadds == -1:
return -1
Expand Down Expand Up @@ -373,7 +374,7 @@ def GetInterfaces(self):
Interface.objects.filter(ip=addr).delete()
logger.warn("IP address %s was reassigned to another host" % (addr,))
except socket.error:
logger.warn("Invalid IP address retuned in GetInterfaces call on Saturn server %s " % (self.serverDNS, ))
logger.warn("Invalid IP address %s retuned in GetInterfaces call on Saturn server %s " % (addr, self.serverDNS ))
var = format_exc()
logger.warn(var)

Expand Down

0 comments on commit 289999c

Please sign in to comment.