Awesome! OK, so I downloaded the hexr source and ran the submission parser script. This basically uses the checkbox submission parser module, parses the xml and produces a json file with a representation of all the stuff like devices, packages and so on.
- bzr branch lp:hexr
- Apply the below patch
- Ensure you have a checkbox source tree somewhere
- Run the parser like this:
PYTHONPATH=$PATH_TO_YOUR_CHECKBOX_TRUNK python apps/uploads/checkbox_parser.py submission.xml -v >/tmp/output.json
Looking at both the output.json and the log.log file produced by the parser, what's happening is that the plainbox submission results in two "devices" dictionaries existing. One is taken from the dmi devices (these are the first 5 devices that plainbox submissions have). The other one contains most devices and is taken from the udev element.
On the other hand, the checkbox-produced submission results in just one "devices" dictionary.
This is helpful in reproducing the problem locally and getting closer to the root cause of the problem. Next I'll look at the ordering of attachments in plainbox vs. checkbox submissions and see if we can do a workaround there. The real fix for this would be having the parser *not* create two "devices" elements, but updating the parser in c4 is slightly more complex.
=== modified file 'apps/uploads/checkbox_parser.py'
--- apps/uploads/checkbox_parser.py 2012-11-21 16:58:07 +0000
+++ apps/uploads/checkbox_parser.py 2013-05-23 19:07:54 +0000
@@ -131,11 +131,13 @@
parser.add_argument("-v", "--verbose", action="store_true", help="Turn-on verbosity to get more info on what's going on.")
+ parser.add_argument("-l", "--logfile", default="log.log",
+ help="Log file")
args = parser.parse_args()
# Set up logger to console
format = '%(asctime)s %(levelname)-8s %(message)s'
- console_handler = logger.StreamHandler()
+ console_handler = logging.StreamHandler()
console_handler.setFormatter(logging.Formatter(format))
# Set up the overall logger
@@ -145,7 +147,7 @@
root_logger.setLevel(logging.DEBUG)
Awesome! OK, so I downloaded the hexr source and ran the submission parser script. This basically uses the checkbox submission parser module, parses the xml and produces a json file with a representation of all the stuff like devices, packages and so on.
- bzr branch lp:hexr $PATH_TO_ YOUR_CHECKBOX_ TRUNK python apps/uploads/ checkbox_ parser. py submission.xml -v >/tmp/output.json
- Apply the below patch
- Ensure you have a checkbox source tree somewhere
- Run the parser like this:
PYTHONPATH=
Looking at both the output.json and the log.log file produced by the parser, what's happening is that the plainbox submission results in two "devices" dictionaries existing. One is taken from the dmi devices (these are the first 5 devices that plainbox submissions have). The other one contains most devices and is taken from the udev element.
On the other hand, the checkbox-produced submission results in just one "devices" dictionary.
This is helpful in reproducing the problem locally and getting closer to the root cause of the problem. Next I'll look at the ordering of attachments in plainbox vs. checkbox submissions and see if we can do a workaround there. The real fix for this would be having the parser *not* create two "devices" elements, but updating the parser in c4 is slightly more complex.
=== modified file 'apps/uploads/ checkbox_ parser. py' checkbox_ parser. py 2012-11-21 16:58:07 +0000 checkbox_ parser. py 2013-05-23 19:07:54 +0000 add_argument( "-v", "--verbose",
action= "store_ true",
help= "Turn-on verbosity to get more info on what's going on.") add_argument( "-l", "--logfile", default="log.log",
--- apps/uploads/
+++ apps/uploads/
@@ -131,11 +131,13 @@
parser.
+ parser.
+ help="Log file")
args = parser.parse_args()
# Set up logger to console StreamHandler( ) StreamHandler( ) handler. setFormatter( logging. Formatter( format) )
format = '%(asctime)s %(levelname)-8s %(message)s'
- console_handler = logger.
+ console_handler = logging.
console_
# Set up the overall logger logger. setLevel( logging. DEBUG)
@@ -145,7 +147,7 @@
root_
if args.verbose: FileHandler( logfile) FileHandler( args.logfile)
verbose_ handler. setLevel( logging. DEBUG)
verbose_ handler. setFormatter( logging. Formatter( format) )
root_ logger. addHandler( verbose_ handler)
- verbose_handler = logging.
+ verbose_handler = logging.