Giter VIP home page Giter VIP logo

Comments (3)

jhjaggars avatar jhjaggars commented on July 4, 2024

I might be misunderstanding your comments, but I think we already have a way to do what you are looking for. In order to support a 'general' plugin for Ubuntu a few things need to happen:

First a ubuntu Policy class must be defined in order to identify a Ubuntu system (and abstract away the package manager bits). See How To Write a Policy for more info (though this page is certainly lacking.)

Secondly, a second class should be defined in the general.py module and be tagged with a UbuntuPlugin tagging class (which also needs to be defined and used by the Ubuntu policy class.)

Another bit to notice is the .name() method that each plugin class now has. If you have several implementations of a plugin (one per distro for example), you can refer to whichever one loaded by the same name as long as you define the name() method in each subclass and have it return the name you would like to use. Something like this:

class myPlugin(RedHatPlugin, Plugin):
    def name(self):
        return "myplugin"

class myUbuntuPlugin(UbuntuPlugin, Plugin):
    def name(self):
        return "myplugin"

from sos.

adam-stokes avatar adam-stokes commented on July 4, 2024

Ah ok let me look into that more and ill close this bug out if i can get it working.

Thanks!

from sos.

adam-stokes avatar adam-stokes commented on July 4, 2024

Can subclass additional policies for separation of plugins per distro

from sos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.