Skip to content
Snippets Groups Projects
Commit 600b5e7f authored by Tim Fechner's avatar Tim Fechner Committed by Tim Fechner
Browse files

Close #16, rename cherrypy.get_server_module_data

parent d878caf0
Branches
No related tags found
No related merge requests found
......@@ -42,10 +42,7 @@ class SaltCherrypyApi(object):
}
)
def get_server_grains(self):
return self.request({'tgt': '*', 'fun': 'grains.items'}).json().get('return')[0]
def get_server_module_data(self, module, target='*', api_args=[], api_kwargs={}):
def get(self, module, target='*', api_args=[], api_kwargs={}):
return self.request({
'fun': module,
'tgt': target,
......
......@@ -78,7 +78,7 @@ class Command(ApiCommand, BaseCommand):
def handle(self, *args, **kwargs):
api = super().handle(*args, **kwargs)
touched_elements = self._update_data(api.get_server_grains())
touched_elements = self._update_data(api.get('grains.items'))
self._cleanup(touched_elements)
api.logout()
......@@ -10,7 +10,7 @@ class Command(ApiCommand, BaseCommand):
help = 'Fetch and save mount points data'
def save_packages(self, api):
mount_point_devices = api.get_server_module_data('ps.disk_partition_usage')
mount_point_devices = api.get('ps.disk_partition_usage')
for minion_fqdn, devices in mount_point_devices.items():
......
......@@ -10,8 +10,8 @@ class Command(ApiCommand, BaseCommand):
help = 'Fetch and save packagedata'
def save_packages(self, api):
packages = api.get_server_module_data('pkg.list_pkgs')
upgrades = api.get_server_module_data('pkg.list_upgrades')
packages = api.get('pkg.list_pkgs')
upgrades = api.get('pkg.list_upgrades')
for minion_fqdn, minion_packages in packages.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment