Modify

Ticket #841 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Metadata.py: xi:include in clients.xml breaks use of -p option at client

Reported by: [email protected] Owned by: laszlo
Priority: major Milestone: Bcfg2 1.2.0 Release
Component: bcfg2-server Version: 1.0
Keywords: Metadata xi:include Cc:

Description

If you have clients defined in a separate file, which is then read in into Metadata/clients.xml using xi:include, you cannot use -p option at client any more.

It looks like xi:includes are not handled consistently in Metadata.py: apparently self.clientdata_original used in method set_profile() of class Metadata does not contain entries from included files.

Reproduction is simple:

  • Let's assume you have already defined profile groups foobar and barfoo in groups.xml
  • Move one or more client entries from clients.xml into separate file, say clientsinc.xml. It will look something like this:
    <Clients>
      <Client uuid="foo" name="bar" profile="foobar" password="xyzzy" pingable="N" location="floating" auth="cert+password"/>
    </Clients>
    
  • Add include entry into clients.xml. Something like
    <xi:include href="clientsinc.xml"/>
    
  • Go to client foo, use a -p option with the client
    # bcfg2 -v -p barfoo
    

This will end up with following error at client:

Fatal error: Failed to set client profile

And following traceback at the server:

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/Bcfg2/Component.py", line 220, in _dispatch
    result = method_func(*args)
  File "/usr/lib/python2.6/dist-packages/Bcfg2/Server/Core.py", line 365, in AssertProfile
    self.metadata.set_profile(client, profile, address)
  File "/usr/lib/python2.6/dist-packages/Bcfg2/Server/Plugins/Metadata.py", line 455, in set_profile
    cli[0].set('profile', profile)
IndexError: list index out of range

Attachments

Change History

comment:1 Changed 12 years ago by solj

  • Milestone changed from Bcfg2 1.1.0 Release to Bcfg2 1.2.0 Release

comment:2 Changed 12 years ago by laszlo

  • Owner changed from desai to laszlo
  • Status changed from new to accepted

Not fixed but handled gracefully from the server in 98643130324d5523e2c819a0d6499ff88e5a6673

comment:3 Changed 12 years ago by laszlo

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

Resolved in e1c429eafbd3ba1b462d75330100684ae26cc1ba. Files included via XInclude are now updated as well.

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.