Update to run under Python 3

Updating charm to support execution under Python 3.

Change-Id: I1429d1c6b634959e0062a8e9f4bc615c58bf31e0
This commit is contained in:
Liam Young
2017-11-21 14:43:13 +00:00
committed by Nicolas Pochet
parent 1cc162e5e5
commit 19aaffaa81
19 changed files with 65 additions and 73 deletions

View File

@@ -11,20 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
_path = os.path.dirname(os.path.realpath(__file__))
_parent = os.path.abspath(os.path.join(_path, ".."))
_hooks = os.path.abspath(os.path.join(_parent, "hooks"))
_actions = os.path.abspath(os.path.join(_parent, "actions"))
def _add_path(path):
if path not in sys.path:
sys.path.insert(1, path)
_add_path(_parent)
_add_path(_hooks)
_add_path(_actions)
sys.path.append('actions')
sys.path.append('hooks')
sys.path.append('unit_tests')