def _clean_assigned_ip(ifname):
    pipe = subprocess.PIPE
    logging.debug("cleaning up current ip assigned to %s" % ifname)
    ip_proc = subprocess.Popen(["ip", "address", "flush", "dev", ifname],
                                stdin=pipe, stdout=pipe, stderr=pipe, env={})
    logging.debug('waiting on pid %d' % ip_proc.pid)
    status = os.waitpid(ip_proc.pid, 0)[1]
    logging.debug('status = %d' % status)

    if status != 0:
        return False
    return True
dataset/ETHPy150Open rackerlabs/openstack-guest-agents-unix/commands/gentoo/network.py/_clean_assigned_ip/original