Update to run under Python 3
Updating charm to support execution under Python 3. Change-Id: I1429d1c6b634959e0062a8e9f4bc615c58bf31e0
This commit is contained in:
committed by
Nicolas Pochet
parent
1cc162e5e5
commit
19aaffaa81
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user