vos: Print "done" in non-verbose 'vos remsite' 27/14127/2
authorAndrew Deason <adeason@sinenomine.net>
Thu, 2 Apr 2020 03:59:38 +0000 (22:59 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 3 Apr 2020 15:24:34 +0000 (11:24 -0400)
Currently, 'vos remsite' always prints the message "Deleting the
replication site for volume %lu ...", and then calls VDONE if the
operation is successful. VDONE prints the trailing "done", but only if
-verbose is turned on, and so if -verbose is not specified, the output
of 'vos remsite' looks broken:

    $ vos remsite fs1 vicepa vol.foo
    Deleting the replication site for volume 1234 ...Removed replication site fs1 /vicepa for volume vol.foo

To fix this, unconditionally print the trailing "done", instead of
going through VDONE, so 'vos remsite' output now looks like this:

    $ vos remsite fs1 vicepa vol.foo
    Deleting the replication site for volume 1234 ... done
    Removed replication site fs1 /vicepa for volume vol.foo

Change-Id: I0b42f4cb9b695331bf047243bf6ae4a1cdbb89c4
Reviewed-on: https://gerrit.openafs.org/14127
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/volser/vsprocs.c

index cddacac..722701f 100644 (file)
@@ -5172,7 +5172,8 @@ UV_RemoveSite(afs_uint32 server, afs_int32 part, afs_uint32 volid)
                      LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
            return (vcode);
        }
-       VDONE;
+       fprintf(STDOUT, " done\n");
+       fflush(STDOUT);
     }
     return 0;
 }