Landscape client in the cloud should only start if it's Landscape-managed (or configured)

Bug #350499 reported by Thomas Herve
2
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
High
Thomas Herve
Landscape Server
Fix Released
High
Thomas Herve

Bug Description

When the client is in a cloud environment and not configured, it should check that the expected data are in the EC2 user-data. If it's not present, the client should not start at all.

Revision history for this message
Thomas Herve (therve) wrote :

The attached branch does most of the job: I think the the only thing missing is to copy the cloud-default.conf in /usr/share/landscape/ during installation.

Changed in landscape-client:
assignee: nobody → therve
importance: Undecided → High
status: New → In Progress
Changed in landscape:
assignee: nobody → therve
importance: Undecided → High
milestone: none → mountainview-pre-8
status: New → In Progress
Revision history for this message
Thomas Herve (therve) wrote :

Please review!

Revision history for this message
Christopher Armstrong (radix) wrote :

[1] It looks like this copies the cloud-default.conf over the configuration file on every startup if we're in cloud mode. That doesn't sound right, since the configuration file will change in certain cases (like if we're running from staging, and the URLs get updated). So if the client would get restarted (e.g. from an upgrade) it'll get messed up.

Revision history for this message
Thomas Herve (therve) wrote :

To workaround that, I put RUN=1 into /etc/default/landscape-client once I copied the config file, so that the next time we run we don't get into the same if branch and don't copy the file again.

Revision history for this message
Christopher Armstrong (radix) wrote :

Okay, that looks better.

+1

I'll need to update the jaunty and intrepid packages to include the same changes...

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Very nice, +1, with one comment, and one detail to watch out during merge:

[1]

- def _extract_ec2_instance_data(self, raw_user_data, launch_index):
+ @classmethod
+ def _extract_ec2_instance_data(cls, raw_user_data, launch_index):
(...)
+ instance_data = RegistrationHandler._extract_ec2_instance_data(
+ raw_user_data, int(launch_index))

It feels like this method ought to be an external function, since it apparently has no relationship with the class and is already being used out of it as a function.

[2]

+ except (pycurl.error, HTTPCodeError):
+ return False

The bug #261253 which is about to go in, introduces a new class for errors so that we don't have to catch from pycurl.error. Can you please check just before merging if free's branch went in or not? I talked to him about doing the same verification on his side, so that we have no logical conflicts which might go undetected by bzr.

Revision history for this message
Thomas Herve (therve) wrote :

Thansk, merged in r95.

Changed in landscape:
status: In Progress → Fix Committed
Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape:
status: Fix Committed → Fix Released
Changed in landscape:
milestone: mountainview-pre-8 → mountainview
status: Fix Released → Fix Committed
Changed in landscape:
status: Fix Committed → Fix Released
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.