]> git.infradead.org Git - users/dhowells/kafs-utils.git/log
users/dhowells/kafs-utils.git
9 years agoRewrite rxgen in python using the ply module master
David Howells [Fri, 4 Sep 2015 10:22:01 +0000 (11:22 +0100)]
Rewrite rxgen in python using the ply module

Signed-off-by: David Howells <dhowells@redhat.com>
9 years agoConvert the xg files to UTF-8 to keep Python happy
David Howells [Sun, 20 Sep 2015 21:53:18 +0000 (22:53 +0100)]
Convert the xg files to UTF-8 to keep Python happy

Signed-off-by: David Howells <dhowells@redhat.com>
9 years agoPackage setup script should be called setup.py
David Howells [Wed, 2 Sep 2015 19:12:54 +0000 (20:12 +0100)]
Package setup script should be called setup.py

Package setup script should be called setup.py so call it that.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "vos create"
David Howells [Wed, 13 Aug 2014 17:47:49 +0000 (18:47 +0100)]
Implement "vos create"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoThe "vos examine" script needs to import AFSException to be able to use it
David Howells [Wed, 13 Aug 2014 17:51:11 +0000 (18:51 +0100)]
The "vos examine" script needs to import AFSException to be able to use it

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix some places IP addresses are output as strings
David Howells [Wed, 13 Aug 2014 17:50:06 +0000 (18:50 +0100)]
Fix some places IP addresses are output as strings

Fix some places IP addresses are supposed to be output as strings but instead
try to output a non-string type.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoStrip AFSVol prefixes from RPC call names in volumeserver.xg
David Howells [Wed, 13 Aug 2014 13:58:45 +0000 (14:58 +0100)]
Strip AFSVol prefixes from RPC call names in volumeserver.xg

Strip AFSVol prefixes from RPC call names in volumeserver.xg as they're
redundant given that the the xg compiler prefixes them with the package name.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years ago"pts createuser" should use PR_NewEntry and not PR_INewEntry
David Howells [Wed, 13 Aug 2014 13:22:38 +0000 (14:22 +0100)]
"pts createuser" should use PR_NewEntry and not PR_INewEntry

"pts createuser" should use PR_NewEntry and not PR_INewEntry for two reasons:
firstly, the latter doesn't return the expected new database entry ID, and
secondly, the latter fails with PRPERM when the former works.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix callers of the prcache eviction functions
David Howells [Wed, 13 Aug 2014 13:27:06 +0000 (14:27 +0100)]
Fix callers of the prcache eviction functions

Fix callers of the prcache eviction functions - they should be calling
evict_*() from the prcache object.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoLimit a multivalued param that is followed by another required param
David Howells [Wed, 13 Aug 2014 12:57:50 +0000 (13:57 +0100)]
Limit a multivalued param that is followed by another required param

A multivalued parameter that is followed by another required parameter is
limited to a single value unless prefaced with its switch, eg:

pts adduser A B C D

B, C and D are group names and A is a user name, despite the user name field
taking multiple values.  In contrast in:

pts adduser -user A B -group C D

A and B are users and only C and D are groups.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoDon't log from the bash_complete script
David Howells [Thu, 12 Jun 2014 08:32:20 +0000 (09:32 +0100)]
Don't log from the bash_complete script

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix some variable deletions in the bash autocomplete handling
David Howells [Thu, 12 Jun 2014 08:19:23 +0000 (09:19 +0100)]
Fix some variable deletions in the bash autocomplete handling

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoProvide bash completion
David Howells [Tue, 20 May 2014 23:04:29 +0000 (00:04 +0100)]
Provide bash completion

Provide bash completion that uses the argument lists in the individual
subcommand files to work out how to complete.  The completion algorithm will
interpolate required flags first and will fully expand flag names.  Flag
parameters will be switched to hostname expansion or cellname expansion as
appropriate.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoAdd a Developer's Certificate of Origin
David Howells [Thu, 15 May 2014 15:27:41 +0000 (16:27 +0100)]
Add a Developer's Certificate of Origin

Add a Developer's Certificate of Origin for the use of people submitting
patches.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts setmax"
David Howells [Thu, 15 May 2014 13:56:36 +0000 (14:56 +0100)]
Implement "pts setmax"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts setfields"
David Howells [Thu, 15 May 2014 13:22:32 +0000 (14:22 +0100)]
Implement "pts setfields"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts chown"
David Howells [Thu, 15 May 2014 12:42:37 +0000 (13:42 +0100)]
Implement "pts chown"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoAdd methods to evict entries from the PR ID<->Name cache
David Howells [Thu, 15 May 2014 13:07:05 +0000 (14:07 +0100)]
Add methods to evict entries from the PR ID<->Name cache

Add methods to evict entries from the PR ID<->Name cache so that interactive
mode can make use of it.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts rename"
David Howells [Thu, 15 May 2014 12:29:51 +0000 (13:29 +0100)]
Implement "pts rename"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts creategroup"
David Howells [Thu, 15 May 2014 11:07:42 +0000 (12:07 +0100)]
Implement "pts creategroup"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts adduser" and "pts removeuser"
David Howells [Thu, 15 May 2014 10:28:59 +0000 (11:28 +0100)]
Implement "pts adduser" and "pts removeuser"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts membership"
David Howells [Wed, 14 May 2014 12:03:00 +0000 (13:03 +0100)]
Implement "pts membership"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts examine"
David Howells [Tue, 13 May 2014 20:47:42 +0000 (21:47 +0100)]
Implement "pts examine"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoProvide a protection DB Name<->ID cache
David Howells [Wed, 14 May 2014 11:14:52 +0000 (12:14 +0100)]
Provide a protection DB Name<->ID cache

Provide a protection DB Name<->ID cache to eliminate redundant lookups and to
reduce the number of NameToID and IDToName RPC calls made by consolidating
multiple requests into single calls.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoAdd a verbosef() display function
David Howells [Wed, 14 May 2014 10:47:18 +0000 (11:47 +0100)]
Add a verbosef() display function

Add a verbosef() display function to do formatted verbose output.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts listowned"
David Howells [Tue, 13 May 2014 20:16:05 +0000 (21:16 +0100)]
Implement "pts listowned"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoBetter iterate over list of ptservers upon failure
David Howells [Tue, 13 May 2014 20:27:56 +0000 (21:27 +0100)]
Better iterate over list of ptservers upon failure

Separate out the iteration over a list of ptservers when one fails.  We don't
want to have to intermingle it with a loop over a list of calls to make (eg. a
list of IDs to be deleted).

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Always check type of objects in a bulk list when encoding arguments
David Howells [Tue, 13 May 2014 20:24:30 +0000 (21:24 +0100)]
rxgen: Always check type of objects in a bulk list when encoding arguments

We should always check the type of the objects in a bulk list when we're
encoding them as part of an argument (or result) list.  Previously we only did
this when we needed to fold things like arrays of ints into an object.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Integer INOUT args should take an int in PyArg_ParseTuple()
David Howells [Tue, 13 May 2014 20:20:08 +0000 (21:20 +0100)]
rxgen: Integer INOUT args should take an int in PyArg_ParseTuple()

Integer INOUT args should take an int in PyArg_ParseTuple() rather than an
arbitrary object as the code now doesn't pass results back through the argument
list.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Support INOUT bulk and struct rpc call args
David Howells [Tue, 13 May 2014 20:18:07 +0000 (21:18 +0100)]
rxgen: Support INOUT bulk and struct rpc call args

We can support INOUT bulk and struct rpc call args since the code now doesn't
try to return results through the argument list.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts listmax"
David Howells [Tue, 13 May 2014 18:36:50 +0000 (19:36 +0100)]
Implement "pts listmax"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts listentries"
David Howells [Tue, 13 May 2014 16:43:30 +0000 (17:43 +0100)]
Implement "pts listentries"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix the help-on-help text
David Howells [Tue, 13 May 2014 16:40:23 +0000 (17:40 +0100)]
Fix the help-on-help text

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts delete"
David Howells [Tue, 13 May 2014 14:59:37 +0000 (15:59 +0100)]
Implement "pts delete"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "pts createuser"
David Howells [Mon, 12 May 2014 12:03:07 +0000 (13:03 +0100)]
Implement "pts createuser"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoHandle exit codes better
David Howells [Tue, 13 May 2014 16:28:11 +0000 (17:28 +0100)]
Handle exit codes better

Returning the intended exit code from the main try block that invokes the
subcommand handler rather than trying to exit within the exception handling
seems to work better and actually return the error code.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoHandle negative numeric command line arguments
David Howells [Tue, 13 May 2014 16:26:40 +0000 (17:26 +0100)]
Handle negative numeric command line arguments

Handle negative numeric command line arguments, distinguishing them from flags
that begin with dashes.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoAdd parsing for the CellServDB file
David Howells [Tue, 13 May 2014 14:02:16 +0000 (15:02 +0100)]
Add parsing for the CellServDB file

Add parsing for the CellServDB file if the DNS doesn't throw up AFSDB or SRV
records for volume location database servers.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoUse the Python ipaddress module to represent IP addresses
David Howells [Tue, 13 May 2014 13:27:58 +0000 (14:27 +0100)]
Use the Python ipaddress module to represent IP addresses

Use the Python ipaddress module to represent IP addresses internally rather
than trying to do it myself.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Handle bulk arguments correctly
David Howells [Tue, 13 May 2014 16:23:37 +0000 (17:23 +0100)]
rxgen: Handle bulk arguments correctly

Need to check for a bulk-class argument of an integer-type before testing for
the integer-type otherwise the integer-type is selected.  This causes the wrong
argument spec to be emitted for PyArg_ParseTuple() when decoding the arguments
for an RPC call to be issued.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Reset call->need_size for each bulk element
David Howells [Sat, 10 May 2014 09:44:10 +0000 (10:44 +0100)]
rxgen: Reset call->need_size for each bulk element

We need to reset call->need_size each time the decode phase for a bulk item
repeats as the value is now whittled down by rxrpc_post_dec().

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Check call->more_recv instead of checking MSG_MORE in rxrpc_recv_data()
David Howells [Tue, 13 May 2014 16:33:51 +0000 (17:33 +0100)]
rxgen: Check call->more_recv instead of checking MSG_MORE in rxrpc_recv_data()

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoPass the right value to verbose() in bos/adduser.py
David Howells [Tue, 13 May 2014 16:32:04 +0000 (17:32 +0100)]
Pass the right value to verbose() in bos/adduser.py

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix the output of "vos listvldb"
David Howells [Tue, 13 May 2014 16:30:45 +0000 (17:30 +0100)]
Fix the output of "vos listvldb"

Fix the output of "vos listvldb" in the following ways:

 (1) Print a blank line between records in the output.

 (2) Adjust the indentation.

 (3) Don't print RW/RO/Backup volume IDs if the corresponding VLSF_xxVOL
     flag is not set.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos getlog" and reengineer the decode path somewhat
David Howells [Thu, 1 May 2014 14:53:03 +0000 (15:53 +0100)]
Implement "bos getlog" and reengineer the decode path somewhat

Implement the "bos getlog" subcommand - which requires making the receive side
of split RPC function work.  To this end, the following reengineering has been
done to the decode side:

 (1) Lift the requirement that the Rx buffer cursor be 4-byte aligned as
     BOZO.GetLog() doesn't align the log data it returns.

 (2) Permit a request for an unknown - and possibly zero - amount of data to be
     set in call->need_size.  BOZO.GetLog() doesn't tell you in advance how
     much data it will return: the data stops when the Rx receive phase ends
     with LAST_PACKET being flagged.

 (3) Separate blob decoding (strings & opaques) from bulk decoding in the
     member variables of the rx_call struct, where a bulk decode is now a
     sequence of blobs, structs or ints.

 (4) Handle blob decoding asynchronously, where the buffer into which a blob is
     being written may not represent contiguous memory.  This is done by
     setting up with an init function, called once, and a decode-into function,
     called repeatedly whilst it returns 1.  The function is only called when
     there is sufficient data in the receive buffers.

 (5) Decode padding asynchronously by working out up front for a blob how much
     padding it requires and then decoding it as its own blob at the end using
     a special source buffer as a marker to switch processing.

 (6) Perform split reception by adding additional states within the decode
     state machine to call out to the handler functions.

The receive() method of the split_handler class provided to a split RPC
function then implements its own state machine on top of the decoder state
machine.

Further:

 (*) rxrpc_recv_data() now reports ENODATA rather than EMSGSIZE if the receive
     phase ends with short data.

 (*) MSG_MORE handling has separate rx_call struct members for the send and
     receive phase now to avoid confusion.

 (*) rxrpc_enc/dec_slow() now use rxrpc_enc/dec_blob() to avoid duplicating a
     lot of code.

 (*) rxrpc_enc/dec() now also go to the slow path if the cursor is misaligned,
     which may mean the data to be read is split across buffers.

 (*) The rx_call struct now has a pointer to a cleanup function to clean up the
     decoder state at the end to deal with aborted calls.

 (*) rxrpc_post_dec() reduces call->need_size as well as call->data_count as we
     don't want to be waiting for N bytes to turn up for a size-N blob if we
     have already received N-1 bytes of it and only need one more byte.

     This does mean that call->need_size may need resetting more often.

 (*) Added an output_raw() python output method to permit bytearray objects to
     be printed.  Conversion to a string means that control characters and
     quotes get escaped (eg. a newline char gets converted to \n).

 (*) Catching the SystemExit exception should not produce an error due to ret
     not existing as a variable.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos setrestricted"
David Howells [Thu, 1 May 2014 14:31:58 +0000 (15:31 +0100)]
Implement "bos setrestricted"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos setrestart"
David Howells [Wed, 30 Apr 2014 12:51:14 +0000 (13:51 +0100)]
Implement "bos setrestart"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "x help" and "x apropos" for all command sets (bos, vos, ...)
David Howells [Tue, 29 Apr 2014 21:44:46 +0000 (22:44 +0100)]
Implement "x help" and "x apropos" for all command sets (bos, vos, ...)

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos removekey"
David Howells [Tue, 29 Apr 2014 21:18:25 +0000 (22:18 +0100)]
Implement "bos removekey"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos addkey"
David Howells [Tue, 29 Apr 2014 18:12:26 +0000 (19:12 +0100)]
Implement "bos addkey"

Implement "bos addkey".  This requires the Kerberos library for the
string-to-key password transformation.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos listkeys"
David Howells [Wed, 16 Apr 2014 07:51:22 +0000 (08:51 +0100)]
Implement "bos listkeys"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos uninstall"
David Howells [Mon, 14 Apr 2014 16:25:09 +0000 (17:25 +0100)]
Implement "bos uninstall"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos install"
David Howells [Wed, 16 Apr 2014 07:20:08 +0000 (08:20 +0100)]
Implement "bos install"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Implement the transmission side of split-mode RPC calls
David Howells [Tue, 15 Apr 2014 08:34:42 +0000 (09:34 +0100)]
rxgen: Implement the transmission side of split-mode RPC calls

Implement the transmission side of RPC calls that are marked with a 'split'
flag - ie. functions in which the caller is allowed to interpolate an
arbitrary transmission blob after the arguments and to receive an arbitrary
blob before the response is received.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Use PyErr_NoMemory() rather than PyExc_MemoryError
David Howells [Wed, 16 Apr 2014 07:18:07 +0000 (08:18 +0100)]
rxgen: Use PyErr_NoMemory() rather than PyExc_MemoryError

Use PyErr_NoMemory() rather than PyExc_MemoryError as the former actually
raises an exception.  The latter is just a class and is then just an object
with no special meaning when returned.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Fix rxrpc_send_data()
David Howells [Tue, 15 Apr 2014 09:42:23 +0000 (10:42 +0100)]
rxgen: Fix rxrpc_send_data()

Make three Fixes to rxrpc_send_data():

 (1) Advance to the next buffer when filling the iovec array rather than
     endlessly cycling over the first one.

 (2) Only clear MSG_MORE if we have sent all the buffered data at the end of
     the transmission phase of a call.

 (3) Don't turn the return value of sendmsg() into just -1 or 0 as we need the
     number of bytes actually sent to allow us to correctly advance the buffer
     cursor.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Clean up the debugging in the AF_RXRPC driver a bit
David Howells [Tue, 15 Apr 2014 09:52:32 +0000 (10:52 +0100)]
rxgen: Clean up the debugging in the AF_RXRPC driver a bit

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos prune"
David Howells [Mon, 14 Apr 2014 15:56:25 +0000 (16:56 +0100)]
Implement "bos prune"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix argument non-combination checking
David Howells [Mon, 14 Apr 2014 16:11:46 +0000 (17:11 +0100)]
Fix argument non-combination checking

10 years agoImplement "bos exec"
David Howells [Mon, 14 Apr 2014 15:31:06 +0000 (16:31 +0100)]
Implement "bos exec"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos restart"
David Howells [Mon, 14 Apr 2014 15:18:59 +0000 (16:18 +0100)]
Implement "bos restart"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos setauth"
David Howells [Mon, 14 Apr 2014 15:08:57 +0000 (16:08 +0100)]
Implement "bos setauth"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoMark accesses to global vars in addrcache as 'global'
David Howells [Mon, 14 Apr 2014 14:23:15 +0000 (15:23 +0100)]
Mark accesses to global vars in addrcache as 'global'

Mark accesses to global vars in the addrcache module as 'global' to make sure
Python doesn't do local access instead.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix up output and error displaying in commands
David Howells [Mon, 14 Apr 2014 12:42:41 +0000 (13:42 +0100)]
Fix up output and error displaying in commands

Fix up output and error displaying in commands so far implemented.  Replace
usage of print() with output() and outputf() for normal operation and error()
for error display.  debug() is replaced with verbose() which is contingent on
the -verbose switch.

Also add error handling to a number of commands.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoProvide argument exception class and check argument length restrictions
David Howells [Mon, 14 Apr 2014 08:23:54 +0000 (09:23 +0100)]
Provide argument exception class and check argument length restrictions

Create an argument error class specifically for the indication of command line
argument problems and catch it in main.py.

Further, provide checking for string arguments that have length restrictions
in the protocol.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Check maximum length of parameter string or opaque
David Howells [Mon, 14 Apr 2014 07:46:45 +0000 (08:46 +0100)]
rxgen: Check maximum length of parameter string or opaque

Check the maximum length of string or opaque parameter to a function and raise
an exception if it is too long.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: The abort table comparator needs to handle big numbers
David Howells [Mon, 14 Apr 2014 07:09:58 +0000 (08:09 +0100)]
rxgen: The abort table comparator needs to handle big numbers

The abort table comparator needs to handle big numbers (larger than
0x7fffffff).  Subtracting a small number from such a big number and then
casting to a signed int results in a negative number, which bsearch()
interprets as indicating that the bigger number is smaller than the smaller
number.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos {adduser,removeuser}"
David Howells [Sun, 13 Apr 2014 11:46:16 +0000 (12:46 +0100)]
Implement "bos {adduser,removeuser}"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos removehost"
David Howells [Sat, 12 Apr 2014 20:06:37 +0000 (21:06 +0100)]
Implement "bos removehost"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos {startup,shutdown}"
David Howells [Sat, 12 Apr 2014 19:50:10 +0000 (20:50 +0100)]
Implement "bos {startup,shutdown}"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos {start,stop}" and make "bos delete" handle multiple instances
David Howells [Sat, 12 Apr 2014 16:47:54 +0000 (17:47 +0100)]
Implement "bos {start,stop}" and make "bos delete" handle multiple instances

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos delete"
David Howells [Sat, 12 Apr 2014 14:53:25 +0000 (15:53 +0100)]
Implement "bos delete"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos create"
David Howells [Sat, 12 Apr 2014 13:58:29 +0000 (14:58 +0100)]
Implement "bos create"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoPreface AFS error messages with the program name
David Howells [Sat, 12 Apr 2014 14:52:45 +0000 (15:52 +0100)]
Preface AFS error messages with the program name

When printing an error message passed through AFSException, preface it with
the name the program was run as.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoProvide separate arg interpretation functions for multivalued arguments
David Howells [Sat, 12 Apr 2014 14:51:03 +0000 (15:51 +0100)]
Provide separate arg interpretation functions for multivalued arguments

Provide separate arg interpretation functions for multivalued arguments so
that the single-valued versions return a non-list and the multivalued returns
a list.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos addhost"
David Howells [Sat, 12 Apr 2014 13:36:28 +0000 (14:36 +0100)]
Implement "bos addhost"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoUse gethostbyname_ex() and gethostbyaddr() rather than the DNS resolver
David Howells [Sat, 12 Apr 2014 13:33:46 +0000 (14:33 +0100)]
Use gethostbyname_ex() and gethostbyaddr() rather than the DNS resolver

Use gethostbyname_ex() and gethostbyaddr() for A and PTR record retrieval
rather than using the DNS resolver directly so that /etc/hosts and suchlike
are also used.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos setcellname"
David Howells [Sat, 12 Apr 2014 12:59:34 +0000 (13:59 +0100)]
Implement "bos setcellname"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos getrestricted"
David Howells [Fri, 11 Apr 2014 23:29:02 +0000 (00:29 +0100)]
Implement "bos getrestricted"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos getrestart"
David Howells [Fri, 11 Apr 2014 23:03:15 +0000 (00:03 +0100)]
Implement "bos getrestart"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos status"
David Howells [Fri, 11 Apr 2014 16:39:28 +0000 (17:39 +0100)]
Implement "bos status"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: The string and bytes decode functions must advance the cursor
David Howells [Fri, 11 Apr 2014 22:57:53 +0000 (23:57 +0100)]
rxgen: The string and bytes decode functions must advance the cursor

The string and bytes decode functions (py_dec_string() and rxrpc_dec_bytes())
need to advance the extraction cursor after extracting so the data doesn't get
reused.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos listusers"
David Howells [Fri, 11 Apr 2014 16:28:56 +0000 (17:28 +0100)]
Implement "bos listusers"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos getdate"
David Howells [Fri, 11 Apr 2014 16:04:43 +0000 (17:04 +0100)]
Implement "bos getdate"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "bos listhosts" and "bos getcell"
David Howells [Fri, 11 Apr 2014 15:46:18 +0000 (16:46 +0100)]
Implement "bos listhosts" and "bos getcell"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoCreate AFS standard date and time format library module
David Howells [Fri, 11 Apr 2014 15:35:02 +0000 (16:35 +0100)]
Create AFS standard date and time format library module

Create an python library module to format date and times in the AFS standard
way.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "vos monitor"
David Howells [Fri, 11 Apr 2014 14:15:39 +0000 (15:15 +0100)]
Implement "vos monitor"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoClean up unnecessary imports
David Howells [Fri, 11 Apr 2014 14:10:03 +0000 (15:10 +0100)]
Clean up unnecessary imports

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoIntroduce a server subclass to hold network name and address information
David Howells [Fri, 11 Apr 2014 13:42:00 +0000 (14:42 +0100)]
Introduce a server subclass to hold network name and address information

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agovos listpart and vos partinfo should use common partition name generation
David Howells [Fri, 11 Apr 2014 12:32:54 +0000 (13:32 +0100)]
vos listpart and vos partinfo should use common partition name generation

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "vos examine"
David Howells [Thu, 10 Apr 2014 13:04:52 +0000 (14:04 +0100)]
Implement "vos examine"

Implement the "vos examine" command.  There is a lot of common display code
between this and several of the other commands, so the common bits are drawn
out into a library module for all to share.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoAllow the volserver class to be instantiated with an int address
David Howells [Fri, 11 Apr 2014 12:27:30 +0000 (13:27 +0100)]
Allow the volserver class to be instantiated with an int address

Allow the volserver class to be instantiated with an int address that
represents a binary coded IPv4 address.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoWhen processing a singular volume name arg, extract it from the array
David Howells [Fri, 11 Apr 2014 12:26:00 +0000 (13:26 +0100)]
When processing a singular volume name arg, extract it from the array

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoC can't just return exception classes to python to raise an exception
David Howells [Fri, 11 Apr 2014 12:24:06 +0000 (13:24 +0100)]
C can't just return exception classes to python to raise an exception

C can't just return exception classes to python to raise an exception, it must
instead call something like PyErr_Format().

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoDeclare RXKAD abort messages
David Howells [Fri, 11 Apr 2014 12:22:24 +0000 (13:22 +0100)]
Declare RXKAD abort messages

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agorxgen: Save trailing comments on error codes in .xg files for exception message
David Howells [Fri, 11 Apr 2014 12:21:28 +0000 (13:21 +0100)]
rxgen: Save trailing comments on error codes in .xg files for exception message

Save the trailing comment on an error code definition in a .xg file and attach
it to the python exception raised if a matching abort is received.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoImplement "vos listvol"
David Howells [Wed, 9 Apr 2014 23:13:39 +0000 (00:13 +0100)]
Implement "vos listvol"

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoSave raw argument list for each switch
David Howells [Thu, 10 Apr 2014 10:19:56 +0000 (11:19 +0100)]
Save raw argument list for each switch

Several of the switch parameters have their argument lists cooked by the
argument parser.  This means we cannot get at the original string(s) when
producing error messages.

Save the raw argument list for each switch in the parameters dictionary as a
list of strings attached to a key of "raw.<switchname>".

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoAdd a convenience module for partition ID handling
David Howells [Thu, 10 Apr 2014 10:17:25 +0000 (11:17 +0100)]
Add a convenience module for partition ID handling

Add a convenience module for partition ID handling.  One function translates
"/vicepX[Y]", "vicepX[Y]", "X[Y]" and "N" into a numeric ID and range checks
it.  Another function translates a numeric ID back into "/vicepX[Y]".

Make the argument parser use it.

Signed-off-by: David Howells <dhowells@redhat.com>
10 years agoFix "vos listaddrs" with -host
David Howells [Wed, 9 Apr 2014 23:05:16 +0000 (00:05 +0100)]
Fix "vos listaddrs" with -host

Fix "vos listaddrs" with -host to expect a host name or ip address rather than
a UUID.

Signed-off-by: David Howells <dhowells@redhat.com>