[tribaal, r=gnuoy] Make the charm not care what the name of the archive is (it looks at the decompressed name instead)
This commit is contained in:
parent
7e630cf3b3
commit
795237155a
|
@ -1,11 +1,9 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import shutil
|
import shutil
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
import sys
|
import sys
|
||||||
import urlparse
|
|
||||||
|
|
||||||
from charmhelpers.core.hookenv import (
|
from charmhelpers.core.hookenv import (
|
||||||
Hooks,
|
Hooks,
|
||||||
|
@ -57,11 +55,16 @@ def install():
|
||||||
|
|
||||||
# install opendaylight
|
# install opendaylight
|
||||||
install_url = config["install-url"]
|
install_url = config["install-url"]
|
||||||
install_remote(install_url, dest="/opt")
|
install_remote(install_url, dest="/opt") # this extracts the archive too
|
||||||
filename = re.sub("^.*/", "", urlparse.urlparse(install_url)[2])
|
|
||||||
name = re.sub("\.tar\.gz$|\.tar$|\.gz$|\.zip$", "", filename)
|
# The extracted dirname. Look at what's on disk instead of mangling, so
|
||||||
|
# the distribution tar.gz's name doesn't matter.
|
||||||
|
name = [f for f in os.listdir("/opt")
|
||||||
|
if f.startswith("distribution-karaf")]
|
||||||
|
|
||||||
if not os.path.exists("/opt/opendaylight-karaf"):
|
if not os.path.exists("/opt/opendaylight-karaf"):
|
||||||
os.symlink(name, "/opt/opendaylight-karaf")
|
os.symlink(name, "/opt/opendaylight-karaf")
|
||||||
|
|
||||||
shutil.copy("files/odl-controller.conf", "/etc/init")
|
shutil.copy("files/odl-controller.conf", "/etc/init")
|
||||||
adduser("opendaylight", system_user=True)
|
adduser("opendaylight", system_user=True)
|
||||||
mkdir("/home/opendaylight", owner="opendaylight", group="opendaylight",
|
mkdir("/home/opendaylight", owner="opendaylight", group="opendaylight",
|
||||||
|
|
Loading…
Reference in New Issue