Skip to content

Commit be64f15

Browse files
authored
Merge pull request #576 from aws/allow-create-with-retired-platform
Allow eb create with a retired platform branch
2 parents 9827108 + 16dcbde commit be64f15

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

ebcli/controllers/create.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from ebcli.objects.exceptions import (
2121
AlreadyExistsError,
2222
InvalidOptionsError,
23-
RetiredPlatformBranchError,
2423
NotFoundError,
2524
)
2625
from ebcli.objects.platform import PlatformVersion, PlatformBranch
@@ -42,7 +41,7 @@
4241
)
4342
from ebcli.operations.tagops import tagops
4443
from ebcli.resources.strings import strings, prompts, flag_text, alerts
45-
from ebcli.resources.statics import elb_names, platform_branch_lifecycle_states
44+
from ebcli.resources.statics import elb_names
4645

4746

4847
class CreateController(AbstractBaseController):
@@ -625,8 +624,6 @@ def _determine_platform(platform_string=None, iprofile=None):
625624
io.log_warning(prompts['ecs.permissions'])
626625
if isinstance(platform, PlatformVersion):
627626
platform.hydrate(elasticbeanstalk.describe_platform_version)
628-
if platform.platform_branch_lifecycle_state == platform_branch_lifecycle_states.RETIRED:
629-
raise RetiredPlatformBranchError(alerts['platformbranch.retired'])
630627
statusops.alert_platform_status(platform)
631628
if 'Multi-container Docker' in platform.platform_name and not iprofile:
632629
io.log_warning(prompts['ecs.permissions'])

tests/unit/controllers/test_create.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
AlreadyExistsError,
2727
InvalidOptionsError,
2828
NotFoundError,
29-
RetiredPlatformBranchError,
3029
)
3130
from ebcli.objects.requests import CreateEnvironmentRequest
3231
from ebcli.objects.platform import PlatformVersion
@@ -216,18 +215,16 @@ def test__determine_platform__with_retired_platform_branch(
216215
'PlatformBranchLifecycleState': 'Retired'
217216
}
218217

219-
self.assertRaises(
220-
RetiredPlatformBranchError,
221-
create._determine_platform,
222-
'PHP 5.3 running on 64bit Amazon Linux')
218+
result = create._determine_platform('PHP 5.3 running on 64bit Amazon Linux')
223219

224220
get_configured_default_platform_mock.assert_not_called()
225221
prompt_for_platform_mock.assert_not_called()
226222
get_platform_for_platform_string_mock.assert_called_once_with(
227223
'PHP 5.3 running on 64bit Amazon Linux')
228224
describe_platform_version_mock.assert_called_once_with(platform_version.platform_arn)
229225
log_warning_mock.assert_not_called()
230-
alert_platform_status_mock.assert_not_called()
226+
alert_platform_status_mock.assert_called_once_with(platform_version)
227+
self.assertEqual(platform_version, result)
231228

232229
@mock.patch('ebcli.controllers.create.platformops.get_configured_default_platform')
233230
@mock.patch('ebcli.controllers.create.platformops.prompt_for_platform')

0 commit comments

Comments
 (0)