Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CQUT-17 'cqosgi' has lost last bundle when used without -m parameter #17

Closed
rakk opened this issue Aug 27, 2014 · 4 comments
Closed

CQUT-17 'cqosgi' has lost last bundle when used without -m parameter #17

rakk opened this issue Aug 27, 2014 · 4 comments
Labels
Milestone

Comments

@rakk
Copy link
Contributor

rakk commented Aug 27, 2014

'cqosgi' is losing last bundle when used without -m parameter

@kitarek kitarek changed the title 'cqosgi' lost last bundle when used without -m parameter CQUT-17 'cqosgi' lost last bundle when used without -m parameter Sep 11, 2014
@kitarek
Copy link
Contributor

kitarek commented Sep 11, 2014

Hi rakk,

thanks for submitting your bug. Actually I've checked the original JSON and the list of bundles provided in pretty printed and machine format and it's correct.

However the number of reported bundles by tool is incorrect and the line ending for -m mode is missing at the end of output stream, which I can confirm.

The explanation (TL;DR)

Please keep in mind correct facts for my CQ instance:

  • My OSGI console gives the total number of bundles set to 325.
  • nl is command which prints line numbers as prefixes for original ones
  • head, tail commands shows given number of lines from the beginning or end of stream
  • wc -l gives number of lines ended correctly by new line character

Please see the outputs below and my explanation:

  • cqosgi is reporting incorrectly only 324 bundles instead of 325. Please also note that I'm using line numbering and showing 3 lines which 2 are numbered as output header:
$ ./cqosgi -u admin | nl | head -n 3
1   324 bundles

2   ID   SYMBOL                                                                 STATUS     VERSION                        NAME
  • The total number of lines is 327 but decreasing number lines counted as header (2) it gives 325 bundles.
 $ ./cqosgi -u admin | nl | tail -n 1
 327        334  com.my.favourite.advanced.osgi.bundle                                   Active     X.Y.Z             My fantastic bundle
  • Actually for machine output the list of bundles contains 325 items:
$ ./cqosgi -m -u admin | nl | tail -n 1
325 334 om.my.favourite.advanced.osgi.bundle                                   Active     X.Y.Z             My fantastic bundle

$ ./cqosgi -m -u admin | nl | head -n 1
 1  0   org.apache.felix.framework  Active  3.0.8.B006  System Bundle

Summary - What is wrong and what should be fixed

  • wc command shows only 324 bundles because there is missing line ending for the last line:

    ./cqosgi -m -u admin | wc -l 
    324
    
  • the tool incorrectly displays only 324 bundles in the header

@kitarek
Copy link
Contributor

kitarek commented Sep 11, 2014

Could you please confirm whether you see the same behavior ?

Thanks once again for submitting the bug.
Arek

@kitarek kitarek added this to the 1.1.2 milestone Sep 11, 2014
@kitarek
Copy link
Contributor

kitarek commented Sep 11, 2014

Please have a look at the branch: https://github.com/Cognifide/CQ-Unix-Toolkit/tree/CQUT-17
Please confirm if this fixes your problem so I will release 1.1.2

@kitarek kitarek added the bug label Sep 11, 2014
@rakk rakk changed the title CQUT-17 'cqosgi' lost last bundle when used without -m parameter CQUT-17 'cqosgi' has lost last bundle when used without -m parameter Sep 30, 2014
kitarek pushed a commit that referenced this issue Oct 3, 2014
* see #17
* when used with -m parameter wc -l command incorrectly count number of
  bundles (missing \n)
* when used without -m parameter (pretty printed format) there is
  a wrong total number of bundles shown in the header but the list
  itself is ok
kitarek added a commit that referenced this issue Oct 3, 2014
* Fixed cqosgi: #17
* See CHANGELOG.md
@kitarek
Copy link
Contributor

kitarek commented Oct 3, 2014

No response so I'm assuming that CQUT-17 branch fixes your problem.
The fix is released in scope of CQ Unix Toolkit 1.1.2.

Arek

@kitarek kitarek closed this as completed Oct 3, 2014
jwadolowski pushed a commit to jwadolowski/CQ-Unix-Toolkit that referenced this issue Jan 16, 2015
… Fix has been partially implemented in response to issue wttech#17.
jwadolowski pushed a commit to jwadolowski/CQ-Unix-Toolkit that referenced this issue May 4, 2015
… Fix has been partially implemented in response to issue wttech#17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants