コード例 #1
0
ファイル: plugins.py プロジェクト: aateem/python-fuelclient
    def sync(self, params):
        """Synchronise plugins on file system with plugins in
           API service, creates plugin if it is not exists,
           updates existent plugins

               fuel plugins --sync
        """
        Plugins.sync()
        self.serializer.print_to_output(
            None, "Plugins were successfully synchronized.")
コード例 #2
0
    def sync(self, params):
        """Synchronise plugins on file system with plugins in
           API service, creates plugin if it is not exists,
           updates existent plugins

               fuel plugins --sync
               fuel plugins --sync --plugin-id=1,2
        """
        Plugins.sync(plugin_ids=params.plugin)
        self.serializer.print_to_output(
            None, "Plugins were successfully synchronized.")
コード例 #3
0
 def install(self, params):
     """Enable plugin for environment
         fuel plugins --install /tmp/plugin_sample.fb
     """
     results = Plugins.install_plugin(params.install, params.force)
     self.serializer.print_to_output(
         results,
         "Plugin {0} was successfully installed.".format(
             params.install))
コード例 #4
0
    def list(self, params):
        """Print all available plugins

                fuel plugins
                fuel plugins --list
        """
        plugins = Plugins.get_all_data()
        self.serializer.print_to_output(
            plugins,
            format_table(plugins, acceptable_keys=self.acceptable_keys))
コード例 #5
0
    def register(self, params):
        """Register plugin in API service

               fuel plugins --register plugin-name==1.0.1
        """
        name, version = self.parse_name_version(params.register)
        result = Plugins.register(name, version, force=params.force)
        self.serializer.print_to_output(
            result,
            "Plugin {0} was successfully registered.".format(params.register))
コード例 #6
0
    def unregister(self, params):
        """Deletes plugin from API service

               fuel plugins --unregister plugin-name==1.0.1
        """
        name, version = self.parse_name_version(params.unregister)
        result = Plugins.unregister(name, version)
        self.serializer.print_to_output(
            result, "Plugin {0} was successfully unregistered."
            "".format(params.unregister))
コード例 #7
0
    def remove(self, params):
        """Remove plugin from file system and from API service

               fuel plugins --remove plugin-name==1.0.1
        """
        name, version = self.parse_name_version(params.remove)
        results = Plugins.remove(name, version)

        self.serializer.print_to_output(
            results,
            "Plugin {0} was successfully removed.".format(params.remove))
コード例 #8
0
ファイル: plugins.py プロジェクト: gdyuldin/python-fuelclient
    def unregister(self, params):
        """Deletes plugin from API service

               fuel plugins --unregister plugin-name==1.0.1
        """
        name, version = self.parse_name_version(params.unregister)
        result = Plugins.unregister(name, version)
        self.serializer.print_to_output(
            result,
            "Plugin {0} was successfully unregistered."
            "".format(params.unregister))
コード例 #9
0
    def install(self, params):
        """Install plugin archive and register in API service

               fuel plugins --install plugin-name-2.0-2.0.1-0.noarch.rpm
        """
        file_path = params.install
        self.check_file(file_path)
        results = Plugins.install(file_path, force=params.force)
        self.serializer.print_to_output(
            results,
            "Plugin {0} was successfully installed.".format(params.install))
コード例 #10
0
ファイル: plugins.py プロジェクト: gdyuldin/python-fuelclient
    def install(self, params):
        """Install plugin archive and register in API service

               fuel plugins --install plugin-name-2.0-2.0.1-0.noarch.rpm
        """
        file_path = params.install
        self.check_file(file_path)
        results = Plugins.install(file_path, force=params.force)
        self.serializer.print_to_output(
            results,
            "Plugin {0} was successfully installed.".format(
                params.install))
コード例 #11
0
    def update(self, params):
        """Update plugin from one minor version to another.
           For example if there is a plugin with version 2.0.0,
           plugin with version 2.0.1 can be used as update. But
           plugin with version 2.1.0, cannot be used to update
           plugin. Note that update is supported for plugins
           beginning from package_version 2.0.0

               fuel plugins --update plugin-name-2.0-2.0.1-0.noarch.rpm
        """
        plugin_path = params.update
        self.check_file(plugin_path)
        result = Plugins.update(plugin_path)
        self.serializer.print_to_output(
            result, "Plugin {0} was successfully updated.".format(plugin_path))
コード例 #12
0
    def downgrade(self, params):
        """Downgrade plugin from one minor version to another.
           For example if there is a plugin with version 2.0.1,
           plugin with version 2.0.0 can be used to perform downgrade.
           Plugin with version 1.0.0, cannot be used to perform downgrade
           plugin. Note that downgrade is supported for plugins
           beginning from package_version 2.0.0

               fuel plugins --downgrade plugin-name-2.0-2.0.1-0.noarch.rpm
        """
        plugin_path = params.downgrade
        self.check_file(plugin_path)
        result = Plugins.downgrade(plugin_path)
        self.serializer.print_to_output(
            result,
            "Plugin {0} was successfully downgraded.".format(plugin_path))
コード例 #13
0
ファイル: plugins.py プロジェクト: gdyuldin/python-fuelclient
    def update(self, params):
        """Update plugin from one minor version to another.
           For example if there is a plugin with version 2.0.0,
           plugin with version 2.0.1 can be used as update. But
           plugin with version 2.1.0, cannot be used to update
           plugin. Note that update is supported for plugins
           beginning from package_version 2.0.0

               fuel plugins --update plugin-name-2.0-2.0.1-0.noarch.rpm
        """
        plugin_path = params.update
        self.check_file(plugin_path)
        result = Plugins.update(plugin_path)
        self.serializer.print_to_output(
            result,
            "Plugin {0} was successfully updated.".format(plugin_path))
コード例 #14
0
    def list(self, params):
        """Print all available plugins

                fuel plugins
                fuel plugins --list
        """
        plugins = Plugins.get_all_data()
        # Replace original nested 'release' dictionary (from plugins meta
        # dictionary) to flat one with necessary release info (os, version)
        for plugin in plugins:
            releases = collections.defaultdict(list)
            for key in plugin['releases']:
                releases[key['os']].append(key['version'])
            plugin['releases'] = ', '.join('{} ({})'.format(k, ', '.join(v))
                                           for k, v in six.iteritems(releases))
        self.serializer.print_to_output(
            plugins,
            format_table(plugins, acceptable_keys=self.acceptable_keys))
コード例 #15
0
    def list(self, params):
        """Print all available plugins

                fuel plugins
                fuel plugins --list
        """
        plugins = Plugins.get_all_data()
        # Replace original nested 'release' dictionary (from plugins meta
        # dictionary) to flat one with necessary release info (os, version)
        for plugin in plugins:
            releases = collections.defaultdict(list)
            for key in plugin['releases']:
                releases[key['os']].append(key['version'])
            plugin['releases'] = ', '.join('{} ({})'.format(k, ', '.join(v))
                                           for k, v in six.iteritems(releases))
        self.serializer.print_to_output(
            plugins, format_table(plugins,
                                  acceptable_keys=self.acceptable_keys))