Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit 3bd0154

Browse files
author
Ben Demboski
committed
Fix argument parsing
yaml doesn't return bytestrings. In python2, six.binary_type is str, so it was working. But in python3 six.binary_type it bytestring, so the config was failing to parse.
1 parent 5076ec0 commit 3bd0154

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

celery_cloudwatch/__main__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import voluptuous as v
44
import yaml
5-
import six
65
import logging
76
import logging.config
87

@@ -11,8 +10,8 @@
1110

1211
config_schema = v.Schema({
1312
v.Optional('ccwatch', default={}): v.Schema({
14-
v.Optional('broker', default=None): v.Any(None, six.binary_type),
15-
v.Optional('camera', default="celery_cloudwatch.CloudWatchCamera"): v.Any(str, six.binary_type),
13+
v.Optional('broker', default=None): v.Any(None, str),
14+
v.Optional('camera', default="celery_cloudwatch.CloudWatchCamera"): str,
1615
v.Optional('verbose', default=False): bool
1716
}, extra=False),
1817
v.Optional('camera', default={}): v.Schema({
@@ -21,20 +20,20 @@
2120
}, extra=False),
2221
v.Optional('cloudwatch-camera', default={}): v.Schema({
2322
v.Optional('dryrun', default=False): bool,
24-
v.Optional('namespace', default='celery'): six.binary_type,
23+
v.Optional('namespace', default='celery'): str,
2524
v.Optional('tasks', default=[]): v.Schema([
26-
six.binary_type, v.Schema({
27-
'name': six.binary_type,
25+
str, v.Schema({
26+
'name': str,
2827
'dimensions': v.Schema({
29-
v.Extra: six.binary_type
28+
v.Extra: str
3029
}, extra=True)
3130
}, extra=False)
3231
]),
3332
v.Optional('task-groups', default=[]): [
3433
v.Schema({
35-
'tasks': [six.binary_type],
34+
'tasks': [str],
3635
'dimensions': v.Schema({
37-
v.Extra: six.binary_type
36+
v.Extra: str
3837
})
3938
})
4039
],

0 commit comments

Comments
 (0)