コード例 #1
0
ファイル: linux_net.py プロジェクト: codevulture/os-vif
def _ovs_vsctl(args, timeout=None):
    full_args = ['ovs-vsctl']
    if timeout is not None:
        full_args += ['--timeout=%s' % timeout]
    full_args += args
    try:
        return processutils.execute(*full_args)
    except Exception as e:
        LOG.error("Unable to execute %(cmd)s. Exception: %(exception)s",
                  {'cmd': full_args, 'exception': e})
        raise exception.AgentError(method=full_args)
コード例 #2
0
def _agilio_vf_mgr(args):
    full_args = ['agilio-vf-mgr.py']
    full_args += args
    try:
        return processutils.execute(
            *full_args,
            run_as_root=True,
            check_exit_code=[0, 1])
    except Exception as e:
        LOG.error("Unable to execute %(cmd)s. Exception: %(exception)s",
                  {'cmd': full_args, 'exception': e})
        raise exception.AgentError(method=full_args)
コード例 #3
0
def _forwarder_port_control(oper, pci_addr, vhu_path):
    cmd = [
        '/usr/lib64/virtio-forwarder/virtioforwarder_port_control.py',
        '%s_sock' % oper,
        '--pci-addr=%s' % pci_addr,
        '--vhost-path=%s' % vhu_path
    ]
    try:
        return processutils.execute(*cmd, check_exit_code=[0, 1])
    except Exception as e:
        LOG.error("Unable to execute %(cmd)s. Exception: %(exception)s", {
            'cmd': cmd,
            'exception': e
        })
        raise exception.AgentError(method=cmd)