Changeset 788 for trunk


Ignore:
Timestamp:
Jul 30, 2008, 9:21:40 PM (16 years ago)
Author:
price
Message:

show root in invirt-getconf, for empty/omitted path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-base/files/usr/sbin/invirt-getconf

    r787 r788  
    4141        opts, args = parser.parse_args()
    4242
    43         try: [key] = args
    44         except: raise invirt_exception(__doc__.strip())
     43        if len(args) > 1:
     44            raise invirt_exception(__doc__.strip())
     45        elif args and args[0]:
     46            components = args[0].split('.')
     47        else:
     48            components = []
    4549
    4650        conf = load(opts.src, opts.cache, opts.refresh)
    47         components = key.split('.')
    4851        for i, component in enumerate(components):
    4952            progress = '.'.join(components[:i])
     
    6164            except IndexError: raise invirt_exception(
    6265                    '%s: index %s out of range' % (progress, component))
     66
    6367        if opts.ls:
    6468            if type(conf) not in [dict, list]:
Note: See TracChangeset for help on using the changeset viewer.