예제 #1
0
파일: cli.py 프로젝트: hmings888/easyOVS
 def do_addflow(self, arg, forced=False):
     """
     addflow [bridge] flow
     Add a flow to a bridge.
     """
     args = arg.replace('"', '').replace("'", "").split()
     if len(args) < 2:
         output('Not enough parameters are given, use like ')
         output('br-int addflow priority=3 ip actions=OUTPUT:1\n')
         return
     bridge, flow_str = args[0], ' '.join(args[1:])
     if not br_exists(bridge):
         if self.bridge:
             bridge, flow_str = self.bridge, ' '.join(args)
         else:
             output('Please give a valid bridge.\n')
             return
     flow = fmt_flow_str(flow_str)
     if not flow:
         output('Please give a valid flow.\n')
         return
     if not br_addflow(bridge, flow):
         output('Add flow <%s> to %s failed.\n' % (flow, bridge))
     else:
         output('Add flow <%s> to %s done.\n' % (flow, bridge))
예제 #2
0
파일: cli.py 프로젝트: lafenicecc/easyOVS
 def do_addflow(self, arg, forced=False):
     """
     addflow [bridge] flow
     Add a flow to a bridge.
     """
     args = arg.replace('"', '').replace("'", "").split()
     if len(args) < 2:
         output('Not enough parameters are given, use like ')
         output('br-int addflow priority=3 ip actions=OUTPUT:1\n')
         return
     bridge, flow_str = args[0], ' '.join(args[1:])
     if not br_exists(bridge):
         if self.bridge:
             bridge, flow_str = self.bridge, ' '.join(args)
         else:
             output('Please give a valid bridge.\n')
             return
     flow = fmt_flow_str(flow_str)
     if not flow:
         output('Please give a valid flow.\n')
         return
     if not br_addflow(bridge, flow):
         output('Add flow <%s> to %s failed.\n' % (flow, bridge))
     else:
         output('Add flow <%s> to %s done.\n' % (flow, bridge))
예제 #3
0
파일: cli.py 프로젝트: cyclefusion/easyOVS
 def do_addflow(self, arg):
     """
     addflow [bridge] flow
     Add a flow to a bridge.
     """
     args = arg.replace('"', "").replace("'", "").split()
     bridge, flow_str = args[0], " ".join(args[1:])
     if not br_exists(bridge) and self.bridge:
         bridge, flow_str = self.bridge, " ".join(args)
     else:
         output("Please give a valid bridge.\n")
         return
     flow = fmt_flow_str(flow_str)
     if not flow:
         output("Please give a valid flow.\n")
         return
     if not br_addflow(bridge, flow):
         output("Add flow <%s> to %s failed.\n" % (flow, bridge))
     else:
         output("Add flow <%s> to %s done.\n" % (flow, bridge))
예제 #4
0
 def do_addflow(self, arg):
     """
     addflow [bridge] flow
     Add a flow to a bridge.
     """
     args = arg.replace('"', '').replace("'", "").split()
     bridge, flow_str = args[0], ' '.join(args[1:])
     if not br_exists(bridge) and self.bridge:
         bridge, flow_str = self.bridge, ' '.join(args)
     else:
         output('Please give a valid bridge.\n')
         return
     flow = fmt_flow_str(flow_str)
     if not flow:
         output('Please give a valid flow.\n')
         return
     if not br_addflow(bridge, flow):
         output('Add flow <%s> to %s failed.\n' % (flow, bridge))
     else:
         output('Add flow <%s> to %s done.\n' % (flow, bridge))