Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-13 Thread Scott Moser
OK.  I just merged this into trunk.

I did some little changes, hopefully not breaking anything.

I still expect some tests on this, and any other clenaups you can do, but I 
wanted to get it pulled in.



Just do additional changes as another merge proposal.

Thank you very much Vaidas.

-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-13 Thread Vaidas Jablonskis
Sounds great. Thanks for helping me out with this, especially the Python
bit (I am still learning it..)


On 13 February 2014 16:03, Scott Moser smo...@ubuntu.com wrote:

 OK.  I just merged this into trunk.

 I did some little changes, hopefully not breaking anything.

 I still expect some tests on this, and any other clenaups you can do, but
 I wanted to get it pulled in.



 Just do additional changes as another merge proposal.

 Thank you very much Vaidas.

 --

 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
 You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.




-- 
Vaidas Jablonskis

https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-12 Thread Scott Moser
OK, for reference:
=== gce ==
$ host metadata.
Host metadata. not found: 3(NXDOMAIN)
$ host metadata
metadata.google.internal has address 169.254.169.254
Host metadata.google.internal not found: 3(NXDOMAIN)
Host metadata.google.internal not found: 3(NXDOMAIN)

$ host metadata.google.internal.
metadata.google.internal has address 169.254.169.254
Host metadata.google.internal not found: 3(NXDOMAIN)
Host metadata.google.internal not found: 3(NXDOMAIN)

$ cat /etc/resolv.conf 
domain c.smoser-00.internal.
search c.smoser-00.internal. 410770698331.google.internal. google.internal.
nameserver 169.254.169.254


=== on ec2 ===
$ host instance-data
instance-data.ec2.internal has address 169.254.169.254
$ host instance-data.
Host instance-data. not found: 3(NXDOMAIN)
$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 172.16.0.23
search ec2.internal

So, using just 'metadata.' will actually not work. It seems like maybe the best 
thign to do is to use 'metadata.google.internal.' and make it configurable.
-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-12 Thread Scott Moser
Vaidas,
  I just proposed a merge into this branch at 
https://code.launchpad.net/~smoser/cloud-init/add-gce-datasource/+merge/206070 .
  That seems reasonable to me on how to configure the metadata_url and get out 
early if there i sno datasource.

So the 2 things we're waiting on are:
 a.) tests
 b.) user-data (just make sure we don't be annoying and re-try on missing).


-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-12 Thread Vaidas Jablonskis
Cool, I'll look into your changes. I am almost done with mine actually. Got
tests, better handling of non-existing metadata endpoints and metadata vs
IP address issue is solved.

I will try to incorporate your changes/suggestion and will update my
branch. Thanks a lot for your help!


On 13 February 2014 01:04, Scott Moser smo...@ubuntu.com wrote:

 Vaidas,
   I just proposed a merge into this branch at
 https://code.launchpad.net/~smoser/cloud-init/add-gce-datasource/+merge/206070.
   That seems reasonable to me on how to configure the metadata_url and get
 out early if there i sno datasource.

 So the 2 things we're waiting on are:
  a.) tests
  b.) user-data (just make sure we don't be annoying and re-try on missing).


 --

 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
 You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.




-- 
Vaidas Jablonskis

https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-10 Thread Scott Moser
Vaidas,
  Hi, and thanks for the merge proposal.

Some things I see:
 * https://launchpad.net/bugs/1040200 raised that 'instance-data' in ec2 
datasource, should be 'instance-data.' so that dns lookups cannot be affected 
by dns search path insertion attack.
   ie, we want: http://metadata./computeMetadata/v1/

 * It seems that user-data is fairly easily implemented via meta-data.
   https://developers.google.com/compute/docs/metadata#common
   In that way, the user should be able to launch an instance with a user-data 
key name 'user-data' and it would appear in instance/attributes/user-data

   You'd want to make sure that this wasn't required, and that if not provided 
we did'nt retry for some annoyingly large amount of time (or even at all).  If 
that key is not present, then just assume ''.

Other than thag, add some tests, and it looks good to me.
Thanks!

-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-08 Thread Joshua Harlow
Seems ok, one change.

resp = url_helper.readurl(url=url_map[mkey], headers=headers)

Can u wrap this with a try: except IOError: block.

Thanks
-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-08 Thread Vaidas Jablonskis
Yep. I will push my changes tonight. Thanks!


On 8 February 2014 20:35, Joshua Harlow harlo...@gmail.com wrote:

 Seems ok, one change.

 resp = url_helper.readurl(url=url_map[mkey], headers=headers)

 Can u wrap this with a try: except IOError: block.

 Thanks
 --

 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
 You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.




-- 
Vaidas Jablonskis

https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-08 Thread Vaidas Jablonskis
Just to let you know, I have pushed the suggested changes already.


On 8 February 2014 20:39, Vaidas Jablonskis jablons...@gmail.com wrote:

 Yep. I will push my changes tonight. Thanks!


 On 8 February 2014 20:35, Joshua Harlow harlo...@gmail.com wrote:

  Seems ok, one change.
 
  resp = url_helper.readurl(url=url_map[mkey], headers=headers)
 
  Can u wrap this with a try: except IOError: block.
 
  Thanks
  --
 
 
 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
  You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.
 



 --
 Vaidas Jablonskis


 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
 You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.




-- 
Vaidas Jablonskis

https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-08 Thread Joshua Harlow
Thanks,

Can we also have some tests :)

U should be able to use httpretty to simulate the gce datasource like is being 
used in:

https://code.launchpad.net/~harlowja/cloud-init/ds-openstack/+merge/204390 
(search for 'test_openstack.py' and for '_register_uris' for the mocking part).


-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-08 Thread Vaidas Jablonskis
I will work on that. Thanks for the guidance!


On 8 February 2014 21:19, Joshua Harlow harlo...@gmail.com wrote:

 Thanks,

 Can we also have some tests :)

 U should be able to use httpretty to simulate the gce datasource like is
 being used in:

 https://code.launchpad.net/~harlowja/cloud-init/ds-openstack/+merge/204390(search
  for 'test_openstack.py' and for '_register_uris' for the mocking
 part).


 --

 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
 You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.




-- 
Vaidas Jablonskis

https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-07 Thread Vaidas Jablonskis
Just to let you know, I pushed suggested changes, could you please review
it and let me know if any issues. Thanks.


On 7 February 2014 01:45, Joshua Harlow harlo...@gmail.com wrote:

 Instead of using requests directly can u use the nice helper we provide
 via url_helper. That should save you from recreating some of the same code.
 --

 https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
 You are the owner of lp:~jablonskis/cloud-init/add-gce-datasource.




-- 
Vaidas Jablonskis

https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init

2014-02-06 Thread Joshua Harlow
Instead of using requests directly can u use the nice helper we provide via 
url_helper. That should save you from recreating some of the same code.
-- 
https://code.launchpad.net/~jablonskis/cloud-init/add-gce-datasource/+merge/204464
Your team cloud init development team is requested to review the proposed merge 
of lp:~jablonskis/cloud-init/add-gce-datasource into lp:cloud-init.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp