Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions ebcli/controllers/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from ebcli.objects.exceptions import (
AlreadyExistsError,
InvalidOptionsError,
RetiredPlatformBranchError,
NotFoundError,
)
from ebcli.objects.platform import PlatformVersion, PlatformBranch
Expand All @@ -42,7 +41,7 @@
)
from ebcli.operations.tagops import tagops
from ebcli.resources.strings import strings, prompts, flag_text, alerts
from ebcli.resources.statics import elb_names, platform_branch_lifecycle_states
from ebcli.resources.statics import elb_names


class CreateController(AbstractBaseController):
Expand Down Expand Up @@ -625,8 +624,6 @@ def _determine_platform(platform_string=None, iprofile=None):
io.log_warning(prompts['ecs.permissions'])
if isinstance(platform, PlatformVersion):
platform.hydrate(elasticbeanstalk.describe_platform_version)
if platform.platform_branch_lifecycle_state == platform_branch_lifecycle_states.RETIRED:
raise RetiredPlatformBranchError(alerts['platformbranch.retired'])
statusops.alert_platform_status(platform)
if 'Multi-container Docker' in platform.platform_name and not iprofile:
io.log_warning(prompts['ecs.permissions'])
Expand Down
9 changes: 3 additions & 6 deletions tests/unit/controllers/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
AlreadyExistsError,
InvalidOptionsError,
NotFoundError,
RetiredPlatformBranchError,
)
from ebcli.objects.requests import CreateEnvironmentRequest
from ebcli.objects.platform import PlatformVersion
Expand Down Expand Up @@ -216,18 +215,16 @@ def test__determine_platform__with_retired_platform_branch(
'PlatformBranchLifecycleState': 'Retired'
}

self.assertRaises(
RetiredPlatformBranchError,
create._determine_platform,
'PHP 5.3 running on 64bit Amazon Linux')
result = create._determine_platform('PHP 5.3 running on 64bit Amazon Linux')

get_configured_default_platform_mock.assert_not_called()
prompt_for_platform_mock.assert_not_called()
get_platform_for_platform_string_mock.assert_called_once_with(
'PHP 5.3 running on 64bit Amazon Linux')
describe_platform_version_mock.assert_called_once_with(platform_version.platform_arn)
log_warning_mock.assert_not_called()
alert_platform_status_mock.assert_not_called()
alert_platform_status_mock.assert_called_once_with(platform_version)
self.assertEqual(platform_version, result)

@mock.patch('ebcli.controllers.create.platformops.get_configured_default_platform')
@mock.patch('ebcli.controllers.create.platformops.prompt_for_platform')
Expand Down
Loading