forked from juju/charm-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch, which when merged, will result in a charmhelpers 1.0.0 release, removes all py27 support code and pre py35 support. This is basically the removal of six and most hacks to support dual running on py27.
- Loading branch information
1 parent
b121bca
commit 5bbe782
Showing
80 changed files
with
374 additions
and
804 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,9 @@ | |
:author: Stuart Bishop <[email protected]> | ||
''' | ||
|
||
import six | ||
|
||
from charmhelpers.core import hookenv | ||
|
||
from collections import OrderedDict | ||
if six.PY3: | ||
from collections import UserDict # pragma: nocover | ||
else: | ||
from UserDict import IterableUserDict as UserDict # pragma: nocover | ||
from collections import OrderedDict, UserDict | ||
|
||
|
||
class Relations(OrderedDict): | ||
|
@@ -166,7 +160,7 @@ def __setitem__(self, key, value): | |
if self.unit != hookenv.local_unit(): | ||
raise TypeError('Attempting to set {} on remote unit {}' | ||
''.format(key, self.unit)) | ||
if value is not None and not isinstance(value, six.string_types): | ||
if value is not None and not isinstance(value, str): | ||
# We don't do implicit casting. This would cause simple | ||
# types like integers to be read back as strings in subsequent | ||
# hooks, and mutable types would require a lot of wrapping | ||
|
@@ -191,7 +185,7 @@ def data(self): | |
def __setitem__(self, key, value): | ||
if not hookenv.is_leader(): | ||
raise TypeError('Not the leader. Cannot change leader settings.') | ||
if value is not None and not isinstance(value, six.string_types): | ||
if value is not None and not isinstance(value, str): | ||
# We don't do implicit casting. This would cause simple | ||
# types like integers to be read back as strings in subsequent | ||
# hooks, and mutable types would require a lot of wrapping | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.