claudyus / LXC-Web-Panel

LXC Web Panel improved for lxc 1.0+
http://claudyus.github.io/LXC-Web-Panel/
Other
221 stars 68 forks source link

Creating a container with an LVM backend creates an LV of 1024mb regardless of the size specified. #100

Closed OrionPseudo closed 8 years ago

OrionPseudo commented 8 years ago

When creating a container with an LVM backend, regardless of the size entered into the form the resulting logical volume created is always 1024M

https://gyazo.com/29d91baaf95e6519042de95b4308d679 https://gyazo.com/4a95376c35e1e852e507ff2ffdf62bc4

OrionPseudo commented 8 years ago

Found and solved. There's a missing + in the following regex: https://github.com/claudyus/LXC-Web-Panel/blob/master/lwp/views/main.py#L494

'^[0-9][G|M]$' will only match if the size is 1 character followed by a G or M. Ex: 1G, 2M are ok but 10G or 100M will fail.

'^[0-9]+[G|M]$' will instead match any set of numbers followed by G or M. Ex: 1G, 2M, 100G, 500M all work.