Modify

Ticket #1131 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

bcfg2-info pipes partial output

Reported by: https://www.google.com/accounts/o8/id?id=AItOawkcI3Ss9yHoQPv6KUCZdrDeUmrgJw4Sokw Owned by: desai
Priority: major Milestone: Bcfg2 1.3.0 Release
Component: bcfg2-server Version: 1.0
Keywords: Cc: myroslav@…

Description

When redirecting 'bcfg2-info groups' output to a file or whatever, not all information is redirected.

I tried on virtual servers

  1. Fedora 16 3.1.0-7.fc16.x86_64 bcfg2-server 1.2.1-2
  2. Fedora 15 2.6.40.3-0.fc15.i686.PAE bcfg2-server 1.2.0-1

So i have redirected command output to a bcfg2-groups file Then copy/paste command output to a file bcfg2-groups-pasted

Here is a result:

  1. Fedora 16, bcfg2-server 1.2.1-2
    [root]# bcfg2-info groups > bcfg2-groups 2>&1
    [root]# ll bcfg2-groups
    -rw-r--r-- 1 root root 14462 Oct  2 12:38 bcfg2-groups
    [root]# wc -l bcfg2-groups
    60 bcfg2-groups
    [root]# ll bcfg2-groups-pasted
    -rw-r--r-- 1 root root 18153 Oct  2 12:43 bcfg2-groups-pasted
    [root]# wc -l bcfg2-groups-pasted 
    95 bcfg2-groups-pasted
    
  1. Fedora 15, bcfg2-server 1.2.0-1
    [root]# bcfg2-info groups > bcfg2-groups 2>&1
    [root]# ll bcfg2-groups
    -rw-rw-r-- 1 root root 35038 Oct  2 05:50 bcfg2-groups
    [root]# wc -l bcfg2-groups
    174 bcfg2-groups
    [root]# ll bcfg2-groups-pasted 
    -rw-rw-r-- 1 root root 36623 Oct  2 05:50 bcfg2-groups-pasted
    [root]# wc -l bcfg2-groups-pasted 
    184 bcfg2-groups-pasted
    

Attachments

Change History

comment:1 Changed 9 years ago by https://www.google.com/accounts/o8/id?id=AItOawkcI3Ss9yHoQPv6KUCZdrDeUmrgJw4Sokw

And problem is that i can't get my group information in script. Is there a better way to achieve this?

comment:2 Changed 9 years ago by https://www.google.com/accounts/o8/id?id=AItOawmhfxIOg3eM29zqtzKItP4pG8fxKrMlb8w

  • Cc myroslav@… added

comment:3 follow-up: ↓ 4 Changed 9 years ago by https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc

  • Milestone set to Bcfg2 1.3.0 Release

I believe there were several fixes to how bcfg2-info produces output (specifically with regards to redirection) in 1.2 at some point. Can you try upgrading to 1.2.3 and see if you still encounter the problem?

If you do, please also provide a diff of the redirected output and the expected (pasted) output, so we can see what's missing. Thanks very much.

comment:4 in reply to: ↑ 3 Changed 9 years ago by https://www.google.com/accounts/o8/id?id=AItOawkcI3Ss9yHoQPv6KUCZdrDeUmrgJw4Sokw

Replying to https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc:

I believe there were several fixes to how bcfg2-info produces output (specifically with regards to redirection) in 1.2 at some point. Can you try upgrading to 1.2.3 and see if you still encounter the problem?

If you do, please also provide a diff of the redirected output and the expected (pasted) output, so we can see what's missing. Thanks very much.

I have compiled version 1.2.3 on fedora 15 and fedora 16
First output is expected(pasted).
Then output a redirected contend
And redirect with tee command. Same problem here

log of actions:

[root@f15-32 ~]# rpm -q bcfg2-server
bcfg2-server-1.2.3-0.0.noarch
[root@f15-32 ~]# uname -a
Linux f15-32 2.6.42.3-2.fc15.i686.PAE #1 SMP Thu Feb 9 01:31:44 UTC 2012 i686 i686 i386 GNU/Linux
[root@f15-32 ~]# bcfg2-info groups
Handled 14 events in 0.004s
 Groups    | Profile  | Category  | Contains  
==============================================
 basic     | yes      |           | redhat    
 debian    | no       |           |           
 freebsd   | no       |           |           
 gentoo    | no       |           |           
 mandrake  | no       |           |           
 redhat    | no       |           |           
 solaris   | no       |           |           
 suse      | no       |           |           
 ubuntu    | no       |           |           
[root@f15-32 ~]# bcfg2-info groups > bcfg2-groups
[root@f15-32 ~]# cat bcfg2-groups 
Handled 14 events in 0.005s
[root@f15-32 ~]# 
[root@f15-32 ~]# bcfg2-info groups | tee bcfg2-groups
Handled 14 events in 0.004s
[root@f15-32 ~]# cat bcfg2-groups 
Handled 14 events in 0.004s
[root@f15-32 ~]#

Here is diff of outputs:

--- bcfg2-groups        2012-10-29 06:15:36.000000000 -0400
+++ bcfg2-groups-pasted 2012-10-29 06:21:12.000000000 -0400
@@ -1 +1,13 @@
-Handled 14 events in 0.004s
+Handled 14 events in 0.005s
+ Groups    | Profile  | Category  | Contains  
+==============================================
+ basic     | yes      |           | redhat    
+ debian    | no       |           |           
+ freebsd   | no       |           |           
+ gentoo    | no       |           |           
+ mandrake  | no       |           |           
+ redhat    | no       |           |           
+ solaris   | no       |           |           
+ suse      | no       |           |           
+ ubuntu    | no       |           | 
+

same problem on fedora 16

comment:5 Changed 9 years ago by solj

  • Status changed from new to closed
  • Resolution set to fixed

This works properly for me with 1.3. Please try the RC and let us know if you are still having issues.

comment:6 Changed 9 years ago by https://www.google.com/accounts/o8/id?id=AItOawmhfxIOg3eM29zqtzKItP4pG8fxKrMlb8w

bcfg2-server 1.3.0pre2 on Python 2.7.3 on Fedora 16 does work regarding this issue. We tested RPM from fedora-rawhide and it has several other issues, but this specific one is fixed.

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.