diff options
| author | Yoggzo <yogg@epsina.com> | 2016-04-19 17:17:14 +0200 |
|---|---|---|
| committer | Yoggzo <yogg@epsina.com> | 2016-04-19 17:17:14 +0200 |
| commit | 2d260aa6f591030f869063ccdb1f6997d12c1294 (patch) | |
| tree | caa312ebf69be823e43a19504fb0754fd0c4315d /server/core/FloatingIp.php | |
| parent | 71794b98c560fa7904a4b3550a21b64ec6cd9339 (diff) | |
correct syntaxt on Network, add tests for automating
Diffstat (limited to 'server/core/FloatingIp.php')
| -rwxr-xr-x | server/core/FloatingIp.php | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/server/core/FloatingIp.php b/server/core/FloatingIp.php index 4271a84..c5a947e 100755 --- a/server/core/FloatingIp.php +++ b/server/core/FloatingIp.php @@ -105,7 +105,16 @@ class floatingIp implements Core{ $this->app->setOutput("Error", "Incorrect parameter opt"); } try{ - $floatingip = null; //obtenir ip + $floatingips = listFloatingIps(); + $floatingIp = null; + foreach ($floatingips as $f) { + if($f['id'] == $id){ + $floatingIp = $f; + } + } + if(!isset($floatingIp)){ + $this->app->setOutput("Error", "Unknowing floatingip id"); + } $floatingip->update(); @@ -139,7 +148,16 @@ class floatingIp implements Core{ $this->app->setOutput("Error", "Incorrect parameter opt"); } try{ - $floatingip = null; //obtenir ip + $floatingips = listFloatingIps(); + $floatingIp = null; + foreach ($floatingips as $f) { + if($f['id'] == $id){ + $floatingIp = $f; + } + } + if(!isset($floatingIp)){ + $this->app->setOutput("Error", "Unknowing floatingip id"); + } $floatingip->delete(); @@ -173,7 +191,16 @@ class floatingIp implements Core{ $this->app->setOutput("Error", "Incorrect parameter opt"); } try{ - $floatingip = null; //obtenir ip + $floatingips = listFloatingIps(); + $floatingIp = null; + foreach ($floatingips as $f) { + if($f['id'] == $id){ + $floatingIp = $f; + } + } + if(!isset($floatingIp)){ + $this->app->setOutput("Error", "Unknowing floatingip id"); + } $floatingip->retrieve(); |
