scheduler-cli Timezone Error
dubrowin opened this issue · comments
Describe the bug
When I try to create a schedule or update a schedule with a timezone, I receive an error
To Reproduce
I installed the schedule-cli on CloudShell and ran the below:
scheduler-cli update-schedule --stack shlomod-instance-scheduler --name my-office-hours-schedule -–timezone 'Asia/Jerusalem'
usage: scheduler-cli [-h] [--version] {create-period,create-schedule,delete-period,delete-schedule,describe-periods,describe-schedule-usage,describe-schedules,update-period,update-schedule} ...
scheduler-cli: error: unrecognized arguments: -–timezone Asia/Jerusalem
according to the documentation, this should be a supported timezone.
https://docs.aws.amazon.com/solutions/latest/instance-scheduler-on-aws/schedules.html
Expected behavior
The scheduler-cli should accept the timezone and configure it in the DynamoDB table correctly.
Please complete the following information about the solution:
- Version: [e.g. v1.0.0]
'scheduler-cli 1.5.3'
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example,
"(SO0030) instance-scheduler-on-aws v1.5.1". You can also find the version from
releases
- Region: [e.g. us-east-1] - us-east-1
- Was the solution modified from the version published on this repository? - no
- If the answer to the previous question was yes, are the changes available on GitHub?
- Have you checked your service quotas for
the sevices this solution uses? - not applicable - Were there any errors in the CloudWatch Logs? - not applicable
Troubleshooting
Additional context
Add any other context about the problem here.
hi @dubrowin
The error you describe indicates a malformed input to the cli rather than there being a problem with the timezone you provided. I copy-pasted the command you provided exactly as-is, and it looks like the second dash in --timezone is not actually a hyphen but some other character, so the cli is failing to parse it. When I correct this, the cli accepts your command without problem (though it does complain that you must provide some periods for your schedule as the update command is a full replacement, not just updating a single value)
Thank you Caleb for the explanation. That faulty dash (-) was taken directly from the AWS Documentation
https://docs.aws.amazon.com/solutions/latest/instance-scheduler-on-aws/sample-schedule.html
Thanks @dubrowin! We'll get that fixed in the doc