def generate(self): """ Generates Python driver by connecting to CloudShell server :return: """ current_path = os.getcwd() shell_package = ShellPackage(current_path) if not shell_package.is_tosca(): click.echo('Code generation supported in TOSCA based shells only', err=True) return shell_name = shell_package.get_shell_name() shell_filename = shell_name + '.zip' package_full_path = path.join(current_path, 'dist', shell_filename) destination_path = path.join(current_path, 'src') cloudshell_config = self.cloudshell_config_reader.read() click.echo('Connecting to Cloudshell server ...') self.driver_generator.generate_driver( cloudshell_config=cloudshell_config, destination_path=destination_path, package_full_path=package_full_path, shell_filename=shell_filename, shell_name=shell_name)
def install(self): current_path = os.getcwd() shell_package = ShellPackage(current_path) if shell_package.is_tosca(): self.shell_package_installer.install(current_path) else: self._install_old_school_shell() click.secho('Successfully installed shell', fg='green')
def pack(self): current_path = os.getcwd() shell_package = ShellPackage(current_path) if shell_package.is_tosca(): self.shell_package_builder.pack(current_path) else: self._pack_old_school_shell(current_path)
def install(self): current_path = os.getcwd() shell_package = ShellPackage(current_path) if shell_package.is_layer_one(): click.secho("Installing a L1 shell directly via shellfoundry is not supported. " "Please follow the L1 shell import procedure described in help.quali.com.", fg="yellow") else: if shell_package.is_tosca(): self.shell_package_installer.install(current_path) else: self._install_old_school_shell() click.secho('Successfully installed shell', fg='green')
def pack(self): current_path = os.getcwd() shell_package = ShellPackage(current_path) if shell_package.is_layer_one(): click.secho( "Packaging a L1 shell directly via shellfoundry is not supported.", fg="yellow") elif shell_package.is_tosca(): self.shell_package_builder.pack(current_path) else: self._pack_old_school_shell(current_path)