Skip to content
Snippets Groups Projects
Commit b47fe5bd authored by Yas Naoi's avatar Yas Naoi
Browse files

Fixed a typo "DescribeAddresses"

parent 0fe8e662
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,8 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
/**
* {@inheritdoc}
*/
private $is_dryrun = true; // true || false, _NOT_ TRUE or FALSE
//private $is_dryrun = true; // true || false, _NOT_ TRUE or FALSE
private $is_dryrun = false; // true || false, _NOT_ TRUE or FALSE
/**
* {@inheritdoc}
......@@ -382,6 +383,7 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
if (!isset($cloud_context)
&& !$config->get('aws_cloud_test_mode')) {
return NULL;
}
......@@ -397,7 +399,8 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
// $mock = new MockHandler(array($this->getMockhandlerResult()));
$ec2_config = $config->get('aws_cloud_test_mode')
? array( // test mode
// test mode
? array(
'credentials' => array(
'key' => bin2hex(openssl_random_pseudo_bytes(8)),
'secret' => bin2hex(openssl_random_pseudo_bytes(10)),
......@@ -406,6 +409,7 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
'version' => 'latest',
// 'handler' => $mock,
)
// Actual Client
: array(
'credentials' => array(
'key' => $cloud_context->aws_access_key(),
......@@ -416,7 +420,10 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
'endpoint' => $cloud_context->endpoint(),
);
// @FIXME
// You may want to restart Apache2 (sytemctl restart apache2)
// if you encounter the error like: "Error: Class 'Aws\\Ec2\\Ec2Client' not found in
// /var/www/html/.../modules/cloud/modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/ApiController.php
// on line 4xx.
$ec2_clients = Ec2Client::factory($ec2_config);
} // until here
......@@ -424,6 +431,8 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
}
// catch (UnresolvedApiException $e) {
catch (\Exception $e) {
// @FIXME
// Handle exception properly
print "passed: Exception: $e";
// var_dump($e);
exit;
......@@ -890,7 +899,7 @@ exit;
public function updateElasticIpList(ConfigInterface $cloud_context) {
$entity_type = $entity_type;
$operation = 'DescribeAddersses';
$operation = 'DescribeAddresses';
$params = array(
'DryRun' => $this->is_dryrun, // true || false,
// 'AllocationIds' => array('<string>', ...),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment