Re: Review Request 25023: CLOUDSTACK-7405: Allow VR metadata to be accessed without trailing slash

2014-11-27 Thread Sebastien Goasguen


> On Aug. 26, 2014, 8:39 p.m., Fred Clift wrote:
> > ./systemvm/patches/debian/config/var/www/html/latest/.htaccess
> > 
> > 
> > That file has a stub-version of the file, and is pre-seeded with one 
> > rewrite rule...
> > 
> > looks like this:
> > 
> > Options +FollowSymLinks
> > RewriteEngine On
> > #RewriteBase /
> > 
> > RewriteRule ^user-data$  ../userdata/%{REMOTE_ADDR}/user-data [L,NC,QSA]
> > 
> > 
> > That rule also probably needs to be updated.
> > 
> > You might also want to look at 
> > 
> > https://reviews.apache.org/r/25065/
> > 
> > 
> > and perhaps we could combine our patches...
> 
> Erik Weber wrote:
> I tested by deleting the .htaccess and restarting the VR.
> This is the total content of .htaccess:
> Options +FollowSymLinks
> RewriteEngine On
> 
> RewriteRule ^user-data/?$  ../userdata/%{REMOTE_ADDR}/user-data [L,NC,QSA]
> RewriteRule ^service-offering/?$  
> ../metadata/%{REMOTE_ADDR}/service-offering [L,NC,QSA]
> RewriteRule ^meta-data/(.+[^/])/?$  ../metadata/%{REMOTE_ADDR}/$1 
> [L,NC,QSA]
> RewriteRule ^meta-data/?$  ../metadata/%{REMOTE_ADDR}/meta-data [L,NC,QSA]
> RewriteRule ^availability-zone/?$  
> ../metadata/%{REMOTE_ADDR}/availability-zone [L,NC,QSA]
> RewriteRule ^local-ipv4/?$  ../metadata/%{REMOTE_ADDR}/local-ipv4 
> [L,NC,QSA]
> RewriteRule ^local-hostname/?$  ../metadata/%{REMOTE_ADDR}/local-hostname 
> [L,NC,QSA]
> RewriteRule ^public-ipv4/?$  ../metadata/%{REMOTE_ADDR}/public-ipv4 
> [L,NC,QSA]
> RewriteRule ^public-hostname/?$  
> ../metadata/%{REMOTE_ADDR}/public-hostname [L,NC,QSA]
> RewriteRule ^instance-id/?$  ../metadata/%{REMOTE_ADDR}/instance-id 
> [L,NC,QSA]
> RewriteRule ^vm-id/?$  ../metadata/%{REMOTE_ADDR}/vm-id [L,NC,QSA]
> RewriteRule ^public-keys/?$  ../metadata/%{REMOTE_ADDR}/public-keys 
> [L,NC,QSA]
> RewriteRule ^cloud-identifier/?$  
> ../metadata/%{REMOTE_ADDR}/cloud-identifier [L,NC,QSA]
> 
> I don't mind combining the patches. If you want to provide it and receive 
> credit I believe this patch has been commited to the 4.3 branch. You can 
> probably provide a patch based on that :-)

erik, can you mark this review as submitted, this is in 4.3 and Fred's patch is 
in master and 4.5


- Sebastien


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25023/#review51588
---


On Aug. 25, 2014, 7:55 p.m., Erik Weber wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25023/
> ---
> 
> (Updated Aug. 25, 2014, 7:55 p.m.)
> 
> 
> Review request for cloudstack, Marcus Sorensen, Sebastien Goasguen, and Wido 
> den Hollander.
> 
> 
> Bugs: CLOUDSTACK-7405
> https://issues.apache.org/jira/browse/CLOUDSTACK-7405
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> ---
> 
> As per https://issues.apache.org/jira/browse/CLOUDSTACK-7405 cloud-init 
> expects to be able to get meta-data directory without using a trailing slash.
> 
> Ultimately this should be fixed in cloud-init, but it's an unintrusive fix in 
> cloudstack
> 
> 
> Diffs
> -
> 
>   systemvm/patches/debian/config/opt/cloud/bin/vmdata.py f508032 
> 
> Diff: https://reviews.apache.org/r/25023/diff/
> 
> 
> Testing
> ---
> 
> tested with curl that both new and old url works
> 
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/vm-id | grep HTTP
> HTTP/1.1 200 OK
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep HTTP
> HTTP/1.1 200 OK
> 
> 
> Thanks,
> 
> Erik Weber
> 
>



Re: Review Request 25023: CLOUDSTACK-7405: Allow VR metadata to be accessed without trailing slash

2014-08-26 Thread Erik Weber


> On Aug. 26, 2014, 8:39 p.m., Fred Clift wrote:
> > ./systemvm/patches/debian/config/var/www/html/latest/.htaccess
> > 
> > 
> > That file has a stub-version of the file, and is pre-seeded with one 
> > rewrite rule...
> > 
> > looks like this:
> > 
> > Options +FollowSymLinks
> > RewriteEngine On
> > #RewriteBase /
> > 
> > RewriteRule ^user-data$  ../userdata/%{REMOTE_ADDR}/user-data [L,NC,QSA]
> > 
> > 
> > That rule also probably needs to be updated.
> > 
> > You might also want to look at 
> > 
> > https://reviews.apache.org/r/25065/
> > 
> > 
> > and perhaps we could combine our patches...

I tested by deleting the .htaccess and restarting the VR.
This is the total content of .htaccess:
Options +FollowSymLinks
RewriteEngine On

RewriteRule ^user-data/?$  ../userdata/%{REMOTE_ADDR}/user-data [L,NC,QSA]
RewriteRule ^service-offering/?$  ../metadata/%{REMOTE_ADDR}/service-offering 
[L,NC,QSA]
RewriteRule ^meta-data/(.+[^/])/?$  ../metadata/%{REMOTE_ADDR}/$1 [L,NC,QSA]
RewriteRule ^meta-data/?$  ../metadata/%{REMOTE_ADDR}/meta-data [L,NC,QSA]
RewriteRule ^availability-zone/?$  ../metadata/%{REMOTE_ADDR}/availability-zone 
[L,NC,QSA]
RewriteRule ^local-ipv4/?$  ../metadata/%{REMOTE_ADDR}/local-ipv4 [L,NC,QSA]
RewriteRule ^local-hostname/?$  ../metadata/%{REMOTE_ADDR}/local-hostname 
[L,NC,QSA]
RewriteRule ^public-ipv4/?$  ../metadata/%{REMOTE_ADDR}/public-ipv4 [L,NC,QSA]
RewriteRule ^public-hostname/?$  ../metadata/%{REMOTE_ADDR}/public-hostname 
[L,NC,QSA]
RewriteRule ^instance-id/?$  ../metadata/%{REMOTE_ADDR}/instance-id [L,NC,QSA]
RewriteRule ^vm-id/?$  ../metadata/%{REMOTE_ADDR}/vm-id [L,NC,QSA]
RewriteRule ^public-keys/?$  ../metadata/%{REMOTE_ADDR}/public-keys [L,NC,QSA]
RewriteRule ^cloud-identifier/?$  ../metadata/%{REMOTE_ADDR}/cloud-identifier 
[L,NC,QSA]

I don't mind combining the patches. If you want to provide it and receive 
credit I believe this patch has been commited to the 4.3 branch. You can 
probably provide a patch based on that :-)


- Erik


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25023/#review51588
---


On Aug. 25, 2014, 7:55 p.m., Erik Weber wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25023/
> ---
> 
> (Updated Aug. 25, 2014, 7:55 p.m.)
> 
> 
> Review request for cloudstack, Marcus Sorensen, Sebastien Goasguen, and Wido 
> den Hollander.
> 
> 
> Bugs: CLOUDSTACK-7405
> https://issues.apache.org/jira/browse/CLOUDSTACK-7405
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> ---
> 
> As per https://issues.apache.org/jira/browse/CLOUDSTACK-7405 cloud-init 
> expects to be able to get meta-data directory without using a trailing slash.
> 
> Ultimately this should be fixed in cloud-init, but it's an unintrusive fix in 
> cloudstack
> 
> 
> Diffs
> -
> 
>   systemvm/patches/debian/config/opt/cloud/bin/vmdata.py f508032 
> 
> Diff: https://reviews.apache.org/r/25023/diff/
> 
> 
> Testing
> ---
> 
> tested with curl that both new and old url works
> 
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/vm-id | grep HTTP
> HTTP/1.1 200 OK
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep HTTP
> HTTP/1.1 200 OK
> 
> 
> Thanks,
> 
> Erik Weber
> 
>



Re: Review Request 25023: CLOUDSTACK-7405: Allow VR metadata to be accessed without trailing slash

2014-08-26 Thread Fred Clift

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25023/#review51588
---


./systemvm/patches/debian/config/var/www/html/latest/.htaccess


That file has a stub-version of the file, and is pre-seeded with one rewrite 
rule...

looks like this:

Options +FollowSymLinks
RewriteEngine On
#RewriteBase /

RewriteRule ^user-data$  ../userdata/%{REMOTE_ADDR}/user-data [L,NC,QSA]


That rule also probably needs to be updated.

You might also want to look at 

https://reviews.apache.org/r/25065/


and perhaps we could combine our patches...

- Fred Clift


On Aug. 25, 2014, 7:55 p.m., Erik Weber wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25023/
> ---
> 
> (Updated Aug. 25, 2014, 7:55 p.m.)
> 
> 
> Review request for cloudstack, Marcus Sorensen, Sebastien Goasguen, and Wido 
> den Hollander.
> 
> 
> Bugs: CLOUDSTACK-7405
> https://issues.apache.org/jira/browse/CLOUDSTACK-7405
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> ---
> 
> As per https://issues.apache.org/jira/browse/CLOUDSTACK-7405 cloud-init 
> expects to be able to get meta-data directory without using a trailing slash.
> 
> Ultimately this should be fixed in cloud-init, but it's an unintrusive fix in 
> cloudstack
> 
> 
> Diffs
> -
> 
>   systemvm/patches/debian/config/opt/cloud/bin/vmdata.py f508032 
> 
> Diff: https://reviews.apache.org/r/25023/diff/
> 
> 
> Testing
> ---
> 
> tested with curl that both new and old url works
> 
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/vm-id | grep HTTP
> HTTP/1.1 200 OK
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep HTTP
> HTTP/1.1 200 OK
> 
> 
> Thanks,
> 
> Erik Weber
> 
>



Re: Review Request 25023: CLOUDSTACK-7405: Allow VR metadata to be accessed without trailing slash

2014-08-26 Thread Sebastien Goasguen

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25023/#review51511
---


applied to 4.3 with b3bfe21cf1e3c73ebdc6b597f32558b63b2fe519

we can wait for Wido and Daan to pick it up for master and 4.4 before closing 
the review and the bug

- Sebastien Goasguen


On Aug. 25, 2014, 7:55 p.m., Erik Weber wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25023/
> ---
> 
> (Updated Aug. 25, 2014, 7:55 p.m.)
> 
> 
> Review request for cloudstack, Marcus Sorensen, Sebastien Goasguen, and Wido 
> den Hollander.
> 
> 
> Bugs: CLOUDSTACK-7405
> https://issues.apache.org/jira/browse/CLOUDSTACK-7405
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> ---
> 
> As per https://issues.apache.org/jira/browse/CLOUDSTACK-7405 cloud-init 
> expects to be able to get meta-data directory without using a trailing slash.
> 
> Ultimately this should be fixed in cloud-init, but it's an unintrusive fix in 
> cloudstack
> 
> 
> Diffs
> -
> 
>   systemvm/patches/debian/config/opt/cloud/bin/vmdata.py f508032 
> 
> Diff: https://reviews.apache.org/r/25023/diff/
> 
> 
> Testing
> ---
> 
> tested with curl that both new and old url works
> 
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/vm-id | grep HTTP
> HTTP/1.1 200 OK
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep HTTP
> HTTP/1.1 200 OK
> 
> 
> Thanks,
> 
> Erik Weber
> 
>



Re: Review Request 25023: CLOUDSTACK-7405: Allow VR metadata to be accessed without trailing slash

2014-08-25 Thread Erik Weber

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25023/
---

(Updated Aug. 25, 2014, 7:55 p.m.)


Review request for cloudstack, Marcus Sorensen, Sebastien Goasguen, and Wido 
den Hollander.


Changes
---

This should make all the urls accessible with and without trailing slash.

Testing done:

without trailing slash:
[root@jenkins ~]# for i in "local-hostname" "local-ipv4" "vm-id" "instance-id" 
; do curl -s -I 10.30.81.1/latest/meta-data/$i | grep HTTP; done
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK


with trailing slash:
[root@jenkins ~]# for i in "local-hostname" "local-ipv4" "vm-id" "instance-id" 
; do curl -s -I 10.30.81.1/latest/meta-data/$i/ | grep HTTP; done
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK


Bugs: CLOUDSTACK-7405
https://issues.apache.org/jira/browse/CLOUDSTACK-7405


Repository: cloudstack-git


Description
---

As per https://issues.apache.org/jira/browse/CLOUDSTACK-7405 cloud-init expects 
to be able to get meta-data directory without using a trailing slash.

Ultimately this should be fixed in cloud-init, but it's an unintrusive fix in 
cloudstack


Diffs (updated)
-

  systemvm/patches/debian/config/opt/cloud/bin/vmdata.py f508032 

Diff: https://reviews.apache.org/r/25023/diff/


Testing
---

tested with curl that both new and old url works

[root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/vm-id | grep HTTP
HTTP/1.1 200 OK
[root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep HTTP
HTTP/1.1 200 OK


Thanks,

Erik Weber



Re: Review Request 25023: CLOUDSTACK-7405: Allow VR metadata to be accessed without trailing slash

2014-08-25 Thread Sebastien Goasguen

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25023/#review51392
---

Ship it!


even though Wido pushed the same fix to master, I applied your patch to 4.3 :)
ac04e6d97ec9e3afeb16937402efbd306fdccae9

thanks, you can mark the review as submitted

- Sebastien Goasguen


On Aug. 25, 2014, 12:05 p.m., Erik Weber wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25023/
> ---
> 
> (Updated Aug. 25, 2014, 12:05 p.m.)
> 
> 
> Review request for cloudstack and Marcus Sorensen.
> 
> 
> Bugs: CLOUDSTACK-7405
> https://issues.apache.org/jira/browse/CLOUDSTACK-7405
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> ---
> 
> As per https://issues.apache.org/jira/browse/CLOUDSTACK-7405 cloud-init 
> expects to be able to get meta-data directory without using a trailing slash.
> 
> Ultimately this should be fixed in cloud-init, but it's an unintrusive fix in 
> cloudstack
> 
> 
> Diffs
> -
> 
>   systemvm/patches/debian/config/opt/cloud/bin/vmdata.py f508032 
> 
> Diff: https://reviews.apache.org/r/25023/diff/
> 
> 
> Testing
> ---
> 
> tested with curl that both new and old url works
> 
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/vm-id | grep HTTP
> HTTP/1.1 200 OK
> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep HTTP
> HTTP/1.1 200 OK
> 
> 
> Thanks,
> 
> Erik Weber
> 
>