Fix auto scale create with fix date without recurrence (#47186) (#47258)

* Fix auto scale create with fix date without  recurrence (#47186)

* Fix auto scale create with fix date without  recurrence

* fix indent

(cherry picked from commit 9258ffa478)

* Create azure_rm_autoscale-fixed_date.yml changelog
This commit is contained in:
Yuwei Zhou 2018-10-23 12:06:22 +08:00 committed by Toshio Kuratomi
parent bac6f99608
commit ab1834f035
2 changed files with 5 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- fix azure_rm_autoscale module can create a schedule with fixed start/end date (https://github.com/ansible/ansible/pull/47186)

View file

@ -549,8 +549,9 @@ class AzureRMAutoScale(AzureRMModuleBase):
schedule=(RecurrentSchedule(time_zone=p.get('recurrence_timezone'),
days=p.get('recurrence_days'),
hours=p.get('recurrence_hours'),
minutes=p.get('recurrence_mins')))
if p.get('recurrence_frequency') else None)) for p in self.profiles or []]
minutes=p.get('recurrence_mins'))))
if p.get('recurrence_frequency') and p['recurrence_frequency'] != 'None' else None)
for p in self.profiles or []]
notifications = [AutoscaleNotification(email=EmailNotification(**n),
webhooks=[WebhookNotification(service_uri=w) for w in n.get('webhooks') or []])