diff mbox

[ovs-dev,ovn-acl] ovn-sbctl: Adjust width for priority in lflow-list.

Message ID 1441763188-6981-1-git-send-email-rbryant@redhat.com
State Accepted
Headers show

Commit Message

Russell Bryant Sept. 9, 2015, 1:46 a.m. UTC
The format string for the output of lflow-list included a width of 3
characters for the priority.  ACLs use priorities up to 5 digits, so
change the width from 3 to 5.  This restores alignment of the next
field, "match".

Signed-off-by: Russell Bryant <rbryant@redhat.com>
---
 ovn/utilities/ovn-sbctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


I did this tiny silly patch against Justin's ovn-acl branch while playing with
it.  Alternatively, we could just drop the width, but I kind of like the
vertical alignment when reading the output.

Comments

Ben Pfaff Sept. 9, 2015, 5:34 a.m. UTC | #1
On Tue, Sep 08, 2015 at 09:46:28PM -0400, Russell Bryant wrote:
> The format string for the output of lflow-list included a width of 3
> characters for the priority.  ACLs use priorities up to 5 digits, so
> change the width from 3 to 5.  This restores alignment of the next
> field, "match".
> 
> Signed-off-by: Russell Bryant <rbryant@redhat.com>

Applied, thanks.

(I remember noticing the "3" and wondering about it earlier.)
Russell Bryant Sept. 9, 2015, 11:24 a.m. UTC | #2
> On Sep 9, 2015, at 1:34 AM, Ben Pfaff <blp@nicira.com> wrote:
> 
>> On Tue, Sep 08, 2015 at 09:46:28PM -0400, Russell Bryant wrote:
>> The format string for the output of lflow-list included a width of 3
>> characters for the priority.  ACLs use priorities up to 5 digits, so
>> change the width from 3 to 5.  This restores alignment of the next
>> field, "match".
>> 
>> Signed-off-by: Russell Bryant <rbryant@redhat.com>
> 
> Applied, thanks.
> 
> (I remember noticing the "3" and wondering about it earlier.)

Yeah, 3 was just based on what was in use at the time, instead of what the full range actually was.
diff mbox

Patch

diff --git a/ovn/utilities/ovn-sbctl.c b/ovn/utilities/ovn-sbctl.c
index 8887c95..c001591 100644
--- a/ovn/utilities/ovn-sbctl.c
+++ b/ovn/utilities/ovn-sbctl.c
@@ -693,7 +693,7 @@  cmd_lflow_list(struct ctl_context *ctx)
         }
 
         const char *table_name = smap_get(&lflow->external_ids, "stage-name");
-        printf("  table=%" PRId64 "(%8s), priority=%3" PRId64
+        printf("  table=%" PRId64 "(%8s), priority=%5" PRId64
                ", match=(%s), action=(%s)\n",
                lflow->table_id, table_name ? table_name : "",
                lflow->priority, lflow->match, lflow->actions);