def install(self, force=False): jujuresources.install(self.resources['oozie'], destination=self.dist_config.path('oozie'), skip_top_level=True) self.dist_config.add_users() self.dist_config.add_dirs() self.dist_config.add_packages() # ExtJS v2.2 should go under self.dist_config.path('ext22') jujuresources.fetch('ext22') src = jujuresources.resource_path('ext22') dest = self.dist_config.path('ext22') shutil.copy(src, dest) # self.dist_config.path('ext22') should also contain all files under # self.dist_config.path('oozie') / 'libtools' src = self.dist_config.path('oozie') / 'libtools' src_files = os.listdir(src) for file_name in src_files: full_file_name = os.path.join(src, file_name) if (os.path.isfile(full_file_name)): shutil.copy(full_file_name, dest) self.setup_oozie_config() self.configure_oozie_hdfs() self.set_oozie_env() self.build_oozie_sharelib() self.build_oozie_war_file() self.build_oozie_db()
def __call__(self): import jujuresources result = True if not jujuresources.verify(self.which): mirror_url = hookenv.config('resources_mirror') hookenv.status_set('maintenance', 'Fetching resources') result = jujuresources.fetch(self.which, mirror_url=mirror_url) if not result: missing = jujuresources.invalid(self.which) hookenv.status_set('blocked', 'Unable to fetch required resource%s: %s' % ( 's' if len(missing) > 1 else '', ', '.join(missing), )) return result
def bootstrap(): hookenv.status_set('maintenance', 'Installing base resources') apt_install(['python-pip', 'git']) # git used for testing unreleased version of libs check_call(['pip', 'install', '-U', 'pip']) # 1.5.1 (trusty) pip fails on --download with git repos mirror_url = hookenv.config('resources_mirror') if not jujuresources.fetch(mirror_url=mirror_url): missing = jujuresources.invalid() hookenv.status_set('blocked', 'Unable to fetch required resource%s: %s' % ( 's' if len(missing) > 1 else '', ', '.join(missing), )) return jujuresources.install(['pathlib', 'jujubigdata']) set_state('bootstrapped')
def __call__(self): import jujuresources result = True if not jujuresources.verify(self.which): mirror_url = hookenv.config("resources_mirror") hookenv.status_set("maintenance", "Fetching resources") result = jujuresources.fetch(self.which, mirror_url=mirror_url) if not result: missing = jujuresources.invalid(self.which) hookenv.status_set( "blocked", "Unable to fetch required resource%s: %s" % ("s" if len(missing) > 1 else "", ", ".join(missing)), ) return result
def bootstrap_resources(): """ Attempt to load and install resources defined in resources.yaml """ if unitdata.kv().get('charm.bootstrapped', False): return True hookenv.status_set('maintenance', 'Installing base resources') mirror_url = jujuresources.config_get('resources_mirror') if not jujuresources.fetch(mirror_url=mirror_url): missing = jujuresources.invalid() hookenv.status_set('blocked', 'Unable to fetch required resource%s: %s' % ( 's' if len(missing) > 1 else '', ', '.join(missing), )) return False jujuresources.install(['pathlib', 'jujubigdata']) unitdata.kv().set('charm.bootstrapped', True) return True
def bootstrap_resources(): """ Install required resources defined in resources.yaml """ if unitdata.kv().get('charm.bootstrapped', False): return True hookenv.status_set('maintenance', 'Installing base resources') mirror_url = jujuresources.config_get('resources_mirror') if not jujuresources.fetch(mirror_url=mirror_url): missing = jujuresources.invalid() hookenv.status_set('blocked', 'Unable to fetch required resource%s: %s' % ( 's' if len(missing) > 1 else '', ', '.join(missing), )) return False jujuresources.install(['pathlib', 'jujubigdata']) unitdata.kv().set('charm.bootstrapped', True) return True