Bug 787055

Summary: Exception with "skynet list -"
Product: [Community] PressGang CCMS Reporter: Joshua Wulf <jwulf>
Component: CSProcessorAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: jwulf, lcarlon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.16.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-22 02:49:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joshua Wulf 2012-02-03 03:11:56 UTC
[jwulf@nitai scratch]$ skynet list -
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
	at java.lang.String.charAt(String.java:694)
	at com.redhat.skynetclient.OptionHandler.parseArgs(OptionHandler.java:785)
	at com.redhat.skynetclient.Client.main(Client.java:57)
	... 5 more

Comment 1 Lee Newson 2012-02-03 04:03:35 UTC
Fixed in 0.16.1.

The problem came from trying to read 2 variables out of an array that only contained one. I've added a check to make sure that it contains at least two variables if not then it'll throw an error.

Comment 2 Joshua Wulf 2012-02-22 02:49:45 UTC
[jwulf@radhe temp]$ csprocessor list -

Error: Invalid argument!

csprocessor list [OPTIONS] [ID]
  OPTIONS:
    --contentspec, -c
    --snapshot, -s
    --force, -F
    
  ID - The ID of the content specification to list snapshots for.