Skip to content

Commit 6192267

Browse files
committed
Fixing noted issues
1 parent ea72ba2 commit 6192267

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/Compute/v2/Api.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ public function getHypervisor(): array
682682
{
683683
return [
684684
'method' => 'GET',
685-
'path' => 'os-hypervisors/{id}',
685+
'path' => 'os-hypervisors/{id}',
686686
'params' => ['id' => $this->params->urlId('id')]
687687
];
688688
}
@@ -691,9 +691,9 @@ public function getAvailabilityZones(): array
691691
{
692692
return [
693693
'method' => 'GET',
694-
'path' => 'os-availability-zone/detail',
694+
'path' => 'os-availability-zone/detail',
695695
'params' => [
696-
'limit' => $this->params->limit(),
696+
'limit' => $this->params->limit(),
697697
'marker' => $this->params->marker()
698698
]
699699
];
@@ -703,9 +703,9 @@ public function getHosts(): array
703703
{
704704
return [
705705
'method' => 'GET',
706-
'path' => 'os-hosts',
706+
'path' => 'os-hosts',
707707
'params' => [
708-
'limit' => $this->params->limit(),
708+
'limit' => $this->params->limit(),
709709
'marker' => $this->params->marker()
710710
]
711711
];
@@ -715,7 +715,7 @@ public function getHost(): array
715715
{
716716
return [
717717
'method' => 'GET',
718-
'path' => 'os-hosts/{name}',
718+
'path' => 'os-hosts/{name}',
719719
'params' => ['name' => $this->params->urlId('name')]
720720
];
721721
}

src/Compute/v2/Models/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Server extends OperatorResource implements
108108
public function create(array $userOptions): Creatable
109109
{
110110
if (!isset($userOptions['imageId']) && !isset($userOptions['blockDeviceMapping']['uuid'])) {
111-
throw new \RuntimeException('Boot-from-volume UUID or image UUID is required');
111+
throw new \RuntimeException('imageId or blockDeviceMapping.uuid must be set.');
112112
}
113113

114114
$response = $this->execute($this->api->postServer(), $userOptions);

tests/unit/Compute/v2/Models/ServerTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public function setUp()
2626
$this->server->id = 'serverId';
2727
}
2828

29+
/**
30+
* @expectedException \RuntimeException
31+
*/
2932
public function test_it_creates()
3033
{
3134
$opts = [
@@ -41,8 +44,13 @@ public function test_it_creates()
4144
]];
4245

4346
$this->setupMock('POST', 'servers', $expectedJson, [], 'server-post');
44-
4547
$this->assertInstanceOf(Server::class, $this->server->create($opts));
48+
49+
$opts = [
50+
'name' => 'foo',
51+
'flavorId' => 'baz',
52+
];
53+
$this->server->create($opts);
4654
}
4755

4856
public function test_it_updates()

0 commit comments

Comments
 (0)