Skip to content
This repository was archived by the owner on May 9, 2020. It is now read-only.

Commit 86b8761

Browse files
kamilbednarzfpedrini
authored andcommitted
Update encryption get_version method to support both string and int params
1 parent e8cc248 commit 86b8761

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chef/encrypted_data_bag_item.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def __setitem__(self, key, value):
2727
@staticmethod
2828
def get_version(data):
2929
if data.has_key('version'):
30-
if data['version'] in EncryptedDataBagItem.SUPPORTED_ENCRYPTION_VERSIONS:
30+
if str(data['version']) in map(str, EncryptedDataBagItem.SUPPORTED_ENCRYPTION_VERSIONS):
3131
return data['version']
3232
else:
3333
raise ChefUnsupportedEncryptionVersionError(data['version'])
3434
else:
35-
return 0
35+
return 1
3636

3737
class Encryptors(object):
3838
@staticmethod

0 commit comments

Comments
 (0)