out_port2) print (" [2] weight : %s" % weight3) print (" actions: Output (%s)" % out_port3) time.sleep(rundelay) # Allocate a placeholder for the group entry group_entry = GroupEntry(group_id, group_type) group_entry.set_group_name(group_name) # Fill in group entry with action buckets # --------- bucket_id = 0 bucket1 = GroupBucket(bucket_id) bucket1.set_weight(weight1) action = OutputAction(order=0, port=out_port1) bucket1.add_action(action) group_entry.add_bucket(bucket1) # --------- bucket_id += 1 bucket2 = GroupBucket(bucket_id) bucket2.set_weight(weight2) action = OutputAction(order=0, port=out_port2) bucket2.add_action(action) group_entry.add_bucket(bucket2) # --------- bucket_id += 1 bucket3 = GroupBucket(bucket_id)
print(" actions: Output (%s)") % out_port1 print(" [1] weight : %s") % weight2 print(" actions: Output (%s)") % out_port2 print(" [2] weight : %s") % weight3 print(" actions: Output (%s)") % out_port3 time.sleep(rundelay) # Allocate a placeholder for the group entry group_entry = GroupEntry(group_id, group_type) group_entry.set_group_name(group_name) # Fill in group entry with action buckets # --------- bucket_id = 0 bucket1 = GroupBucket(bucket_id) bucket1.set_weight(weight1) action = OutputAction(order=0, port=out_port1) bucket1.add_action(action) group_entry.add_bucket(bucket1) # --------- bucket_id += 1 bucket2 = GroupBucket(bucket_id) bucket2.set_weight(weight2) action = OutputAction(order=0, port=out_port2) bucket2.add_action(action) group_entry.add_bucket(bucket2) # --------- bucket_id += 1 bucket3 = GroupBucket(bucket_id)