jhershberg / netvirt-ha-docker

3 stars 2 forks source link

./karaf-client with commands does not (always) work #11

Open vorburger opened 5 years ago

vorburger commented 5 years ago

This is OK:

./karaf-client 1 showSvcStatus

but this is NOK:

./karaf-client 1 showSvcStatus --help       
executing "/odlha/karaf/target/assembly/bin/client showSvcStatus --help" on 1.........................................
client: JAVA_HOME not set; results may vary
Apache Karaf client ...

even though this works (except for ODLPARENT-170):

./karaf-client 1                     
executing "/odlha/karaf/target/assembly/bin/client" on 1.........................................
client: JAVA_HOME not set; results may vary
Logging in as karaf

    ________                       ________                .__  .__       .__     __       
    \_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_     
     /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\    
    /    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |      
    \_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|      
            \/|__|        \/     \/        \/     \/\/            /_____/      \/          

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

Error in initialization script: /odlha/karaf/target/assembly/etc/shell.init.script: String index out of range: 0
opendaylight-user@root>showSvcStatus --help
DESCRIPTION
        diagstatus:showSvcStatus

    show the status of registered services

SYNTAX
        diagstatus:showSvcStatus [options]

OPTIONS
        --help

The same can be seen here with this example from the README:

./karaf-client 1 feature:list ==> works and prints feature list

but again if we pass any arguments, then it's NOK:

./karaf-client 1 feature:list --help
executing "/odlha/karaf/target/assembly/bin/client feature:list --help" on 1.........................................
client: JAVA_HOME not set; results may vary
Apache Karaf client ...

It's curious though that this example does seem work, I don't get how this is fundamtentally different:

./karaf-client 1 log:set DEBUG org.opendaylight.genius

@jhershberg more filing this here FYI - not a bid deal to work around, once you know it, of course.

jhershberg commented 5 years ago

Yeah, I've seen this as well and we should fix it at some point. It's almost certainly something dumb