Merge lp://staging/~abentley/juju-release-tools/agents-stanzas-2 into lp://staging/juju-release-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 233
Proposed branch: lp://staging/~abentley/juju-release-tools/agents-stanzas-2
Merge into: lp://staging/juju-release-tools
Diff against target: 181 lines (+106/-36)
2 files modified
make-ubuntu-agent.bash (+2/-2)
make_agent_json.py (+104/-34)
To merge this branch: bzr merge lp://staging/~abentley/juju-release-tools/agents-stanzas-2
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+277051@code.staging.launchpad.net

Commit message

Support all kinds of stanzas.

Description of the change

This branch adds support for alternate agent generation.

It supports Windows and Centos, but also supports using a single agent for all "living" ubuntus.

Because the number of parameters was getting unweildy, it creates a class to hold them. This class has various factory methods to support different generation approaches.

Since make_stanza can now make multiple stanzas, it is renamed to make_agent_json.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

I have a few comments inline.

review: Needs Information (code)
237. By Aaron Bentley

Updates from review.

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I've pushed a new version with the changes you asked for.

>> + self.version_name = date.today().strftime('%Y%m%d')
>
> Could this get weird if we build on machines in different
> timezones? maybe datetime.utcnow().strftime('%Y%m%d') is safer

The odds are low, because versions are only relevant if there are
competing item_names for a given content_id, and we don't do that.

Even if we did, items with the a given item_name will typically be built
on the same machine every time, so they will have the same timezone.

Still, there's no harm in using UTC time. Done.

>> + self.filename = filename + + @classmethod + def
>> for_ubuntu(cls, release, series, arch, version, revision_build,
>
> As an aside, I am constantly annoyed that debian calls the
> series/codename release, so when I work with lxc templates or
> scripts that make changelogs, I pass the series as the release.
> What we call a release is closer to debian version. While we don't
> see it often, I see that precise and trusty in the clouds are
> actually 12.04.5 and 14.04.2. There is no right ways to think about
> this.

The vagueness about release/series/codename bugs me, too. (And I can't
help wondering whether we really need both :-) Still, I tried to use
the terminology of the job. That meant that I had to do to do
"stanza['release'] = series" in make_stanzas(). Ugh.

> We need a single definition of this list that can be imported. Can
> you make this list a module level constant? I want formal
> definition of the series we support.

Done.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWQgD5AAoJEK84cMOcf+9hAQQH/0+zqHNBoQ6+J4EwYMWcUln4
M0JaHGfe2XJXlrmlwqGRpYBtTrEcH9DWiCih1/2I7QyY4dXcpVoUtqkPqA8ROBTD
gZNjJRVQapWSStxs+4snfDVatGxmaM+/A+ayq4Vzp8XGSiteSxOQZVQRs0b3d+cE
3HooPlNx2m2pdqiY4s+6fDFkhqUSjJmyxq4un03LAmH/gjOhuZcyNzpt9+PjBfjI
6iI/xtC2U/hBW3gcZW8Qk7HyVCHPOW6aGKomMGNN9HX/E0vkZAfOihEdBc7xZYp2
H4hdA+s6UjzO9QjNDF37t7STmzLSXTYQeMmUF92rr9+yQed1leuU7BL6naPBkfQ=
=8nzG
-----END PGP SIGNATURE-----

Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches