def set_share_inventory(self, share_inventory, hostid=None, hostname=None):
     '''update if we share the chosen host inventory on the server'''
     try:
         Hosts().set_share_inventory(share_inventory, hostid, hostname)
     except HostError as e:
         print(e)
         sys.exit(1)
    def __init__(self, hosts=None):

        self.hosts = hosts
        if not hosts:
            self.hosts = Hosts()
        self.distro = get_distro()
        if not self.distro:
            raise PackageSetInitError(
                "Can't initialize PackageSetHandler: no valid distro provided")
        self.last_storage_sync = None

        # create cache for storage package list, indexed by hostid
        self.package_list = {}
Exemple #3
0
    def __init__(self, loop):
        '''registration over dbus'''
        bus_name = dbus.service.BusName(ONECONF_SERVICE_NAME,
                                        bus=dbus.SessionBus())
        dbus.service.Object.__init__(self, bus_name, HOSTS_OBJECT_NAME)
        # Only import oneconf module now for only getting it on server side
        from oneconf.hosts import Hosts

        self.hosts = Hosts()
        self._packageSetHandler = None
        self.activity = False
        self.synchandler = None
        self.loop = loop
 def get_last_sync_date(self):
     '''get last time the store was successfully synced'''
     return Hosts().get_last_sync_date()
 def get_all_hosts(self):
     '''get a dict of all available hosts'''
     return Hosts().get_all_hosts()