Пример #1
0
 def test_update_status_db(self, mock_couchdb):
     """Update statusdb."""
     disk_space = {
         'localhost': {
             'disk_size': '14%',
             'mounted_on': '/System/Volumes/Data',
             'available_percentage': '100%',
             'space_used': '1061701',
             'used_percentage': '0%',
             'filesystem': '393Gi',
             'space_available': '4881391179'
         }
     }
     server_status.update_status_db(disk_space, server_type='nas')
Пример #2
0
def uppmax(disk_quota, cpu_hours):
    """
    Checks the quotas and cpu hours on the uppmax servers
    """
    merged_results = {}
    if disk_quota:
        disk_quota_data = status.get_uppmax_quotas()
        merged_results.update(disk_quota_data)
    if cpu_hours:
        cpu_hours_data = status.get_uppmax_cpu_hours()
        if not merged_results:
            merged_results = cpu_hours_data
        else:
            for key in cpu_hours_data.keys():
                if key not in merged_results:
                    merged_results[key] = cpu_hours_data[key]
                else:
                    merged_results[key].update(cpu_hours_data[key])
    status.update_status_db(merged_results, server_type='uppmax')
Пример #3
0
def uppmax(disk_quota, cpu_hours):
    """
    Checks the quotas and cpu hours on the uppmax servers
    """
    merged_results = {}
    if disk_quota:
        disk_quota_data = status.get_uppmax_quotas()
        merged_results.update(disk_quota_data)
    if cpu_hours:
        cpu_hours_data = status.get_uppmax_cpu_hours()
        if not merged_results:
            merged_results = cpu_hours_data
        else:
            for key in cpu_hours_data.keys():
                if key not in merged_results:
                    merged_results[key] = cpu_hours_data[key]
                else:
                    merged_results[key].update(cpu_hours_data[key])
    status.update_status_db(merged_results, server_type='uppmax')
Пример #4
0
def nases(statusdb):
    """ Checks the available space on all the nases
    """
    disk_space = status.get_nases_disk_space()
    if statusdb:
        status.update_status_db(disk_space, server_type='nas')
Пример #5
0
def nases(statusdb):
    """ Checks the available space on all the nases
    """
    disk_space = status.get_nases_disk_space()
    if statusdb:
        status.update_status_db(disk_space, server_type='nas')