Really minor enhancement to Aptitude Role

12 views
Skip to first unread message

rcmachado

unread,
Nov 24, 2012, 2:04:29 PM11/24/12
to pr...@googlegroups.com
Hi folks,

First of all I was in your presentation in PythonBrasil 8 about provy and I really liked it (specially the roles concept). I've already looked for other projects to easy provisioning servers and deploying applications - I've seen cuisine [https://github.com/sebastien/cuisine/] and even started a project called fabix [https://github.com/quatix/fabix/] but their goals are more toward to deploy phase, but I think maybe provy will superseded both.

So, I'm looking to the code and see one really small improvement to AptitudeRole.ensure_aptitude_source method: instead of just adding the repo info to /apt/etc/sources.list maybe it could add a new file /etc/apt/sources.list.d (as AptitudeRole.has_source already checks on this directory). What do you think about that? May I submit a patch to this?

Thanks,
Rodrigo Machado

Bernardo Heynemann

unread,
Nov 24, 2012, 2:09:42 PM11/24/12
to provy
Please DO! :)

Cheers,

Bernardo Heynemann
Developer @ globo.com

rcmachado

unread,
Nov 25, 2012, 10:18:33 PM11/25/12
to pr...@googlegroups.com
Hi,

I've made the modification on ensure_aptitude_role, but I'm not confortable with it yet.

I had to add an optional argument to the method called source_name. If provided, the source line will be added to a file <source_name>.list on sources.list.d directory. Well, the problem with this approach is that now the method will behave differently if this second parameter was provided.

A couple of solutions to this problem:

1) "slugify" the source line and use it as a name. This could make the filename something like packages.ubuntu.com-natty-something-foo-bar.list, which IMHO is not very good. (Maybe we could use just hostname part and append to that file?)

OR

2) just revert the modification (so the repo will continue to be added to sources.list). The disadvantage is if we update the system maybe (I didn't test it yet) this file will be overwritten by the new one.

What do you think?

Thanks,
Rodrigo Machado

rcmachado

unread,
Nov 25, 2012, 10:19:35 PM11/25/12
to pr...@googlegroups.com
Sorry, I forgot to provide the link to commit:


Thanks,
Rodrigo

Diogo Baeder

unread,
Nov 26, 2012, 7:59:52 AM11/26/12
to pr...@googlegroups.com
Hi Rodrigo!

So, we're already planning to release a 0.6.0 version, and it will contain API changes (so far not to the existing ones, as we have in our master right now, but new roles and calls will be included); That being said, I'm OK with that change (and I liked the idea to have that parameter and that implementation), as it is backwards-compatible.

What I ask is just to keep the documentation up-to-date with that, making it clear that this parameter changes the way that the repository is inserted.

Cheers!

__________________________
Diogo Baeder
http://diogobaeder.com.br

Bernardo Heynemann

unread,
Nov 26, 2012, 10:05:09 AM11/26/12
to provy
I'd rather not have an extra argument and instead have the file named like:

(Base64Hash of the line added)[:12]_(repository domain sluggified)

It's clearer and backwards compatible.

Does that sound feasible?

Cheers,
Bernardo Heynemann



Bernardo Heynemann
Developer @ globo.com


Diogo Baeder

unread,
Nov 26, 2012, 11:29:49 AM11/26/12
to pr...@googlegroups.com
Sounds good enough for me, as well. I'm OK with both changes.

Cheers,

__________________________
Diogo Baeder
http://diogobaeder.com.br


Rodrigo Machado

unread,
Nov 26, 2012, 11:54:20 AM11/26/12
to pr...@googlegroups.com
Hm, looks good to me. In fact, I think its better because we will have only one behavior. I'll make the modifications and submit the pull request.

Thanks for the feedback,
--
Rodrigo Machado
Reply all
Reply to author
Forward
0 new messages