def register_services(): services = { 'AFP': 'netatalk', 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'Active Directory': 'active-directory', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'SNMP': 'snmpd', 'Rock-on': 'docker', 'S.M.A.R.T': 'smartd', 'NUT-UPS': 'nut', 'ZTaskd': 'ztask-daemon', 'Bootstrap': 'rockstor-bootstrap', } for k,v in services.items(): try: so = Service.objects.get(name=v) so.display_name = k except Service.DoesNotExist: so = Service(display_name=k, name=v) finally: so.save() for so in Service.objects.filter(): if (so.display_name not in services): so.delete()
def register_services(): services = {'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'AD': 'winbind',} for s in services.keys(): if (not Service.objects.filter(display_name=s).exists()): s_o = Service(display_name=s, name=services[s]) s_o.save()
def register_services(): service_list = ( 'nfs', 'samba', 'sftp', 'ldap', 'ad', 'iscsi', 'nis', ) for s in service_list: if (not Service.objects.filter(name=s).exists()): s_o = Service(name=s, registered=True) s_o.save()
def register_services(): services = { 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'AD': 'winbind', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'Task Scheduler': 'task-scheduler', 'Data Collector': 'data-collector', 'Service Monitor': 'service-monitor', } for s in services.keys(): if (not Service.objects.filter(display_name=s).exists()): s_o = Service(display_name=s, name=services[s]) s_o.save()
def register_services(): services = { 'AFP': 'netatalk', 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'AD': 'winbind', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'Task Scheduler': 'task-scheduler', 'Data Collector': 'data-collector', 'Service Monitor': 'service-monitor', 'SNMP': 'snmpd', } for s in services.keys(): if (not Service.objects.filter(display_name=s).exists()): s_o = Service(display_name=s, name=services[s]) s_o.save()
def register_services(): services = { 'AFP': 'netatalk', 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'Active Directory': 'active-directory', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'SNMP': 'snmpd', 'Rock-on': 'docker', 'S.M.A.R.T': 'smartd', 'NUT-UPS': 'nut', 'ZTaskd': 'ztask-daemon', 'Bootstrap': 'rockstor-bootstrap', } for k, v in services.items(): try: so = Service.objects.get(name=v) so.display_name = k except Service.DoesNotExist: so = Service(display_name=k, name=v) finally: so.save() for so in Service.objects.filter(): if (so.display_name not in services): so.delete()
def register_services(): services = { 'AFP': 'netatalk', 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'Active Directory': 'active-directory', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'SNMP': 'snmpd', 'Rock-on': 'docker', 'S.M.A.R.T': 'smartd', 'NUT-UPS': 'nut', 'ZTaskd': 'ztask-daemon', 'Bootstrap': 'rockstor-bootstrap', 'Shell In A Box': 'shellinaboxd', 'Rockstor': 'rockstor' } services_configs = { 'shellinaboxd': ('{"detach": false, "css": "white-on-black", ' '"shelltype": "LOGIN"}') } for k, v in services.items(): try: so = Service.objects.get(name=v) so.display_name = k if v in services_configs: so.config = services_configs[v] except Service.DoesNotExist: so = Service(display_name=k, name=v) finally: so.save() for so in Service.objects.filter(): if (so.display_name not in services): so.delete()
def register_services(): services = { 'AFP': 'netatalk', 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'AD': 'winbind', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'SNMP': 'snmpd', 'Rock-on': 'docker', 'S.M.A.R.T': 'smartd',} keylist = services.keys() for s in keylist: if (not Service.objects.filter(display_name=s).exists()): s_o = Service(display_name=s, name=services[s]) s_o.save() for so in Service.objects.filter(): if (so.display_name not in keylist): so.delete()
def register_services(): services = { 'AFP': 'netatalk', 'NFS': 'nfs', 'Samba': 'smb', 'NIS': 'nis', 'NTP': 'ntpd', 'Active Directory': 'active-directory', 'LDAP': 'ldap', 'SFTP': 'sftp', 'Replication': 'replication', 'SNMP': 'snmpd', 'Rock-on': 'docker', 'S.M.A.R.T': 'smartd', 'NUT-UPS': 'nut', } keylist = services.keys() for s in keylist: if (not Service.objects.filter(display_name=s).exists()): s_o = Service(display_name=s, name=services[s]) s_o.save() for so in Service.objects.filter(): if (so.display_name not in keylist): so.delete()
def register_services(): services = { "NFS": "nfs", "Samba": "smb", "NIS": "nis", "NTP": "ntpd", "Active Directory": "active-directory", "LDAP": "ldap", "SFTP": "sftp", "Replication": "replication", "SNMP": "snmpd", "Rock-on": "docker", "S.M.A.R.T": "smartd", "NUT-UPS": "nut", # ZTaskd display/service names maintained: but are now huey pseudonyms. "ZTaskd": "ztask-daemon", "Bootstrap": "rockstor-bootstrap", "Shell In A Box": "shellinaboxd", "Rockstor": "rockstor", } # N.B. all other services have null as their default config with service. # Consider bringing shellinaboxd in line with this now default behaviour. services_configs = { "shellinaboxd": ('{"detach": false, "css": "white-on-black", ' '"shelltype": "LOGIN"}') } for k, v in services.items(): try: so = Service.objects.get(name=v) so.display_name = k # Apply any configuration defaults found in services_configs. if v in services_configs: so.config = services_configs[v] except Service.DoesNotExist: so = Service(display_name=k, name=v) finally: so.save() for so in Service.objects.filter(): if so.display_name not in services: so.delete()
def register_services(): service_list = ('nfs', 'samba', 'sftp', 'ldap', 'ad', 'iscsi',) for s in service_list: if (not Service.objects.filter(name=s).exists()): s_o = Service(name=s, registered=True) s_o.save()
def register_services(): service_list = ('nfs', 'samba', 'sftp', 'ldap', 'ad', 'iscsi',) Service.objects.all().delete() for s in service_list: s_o = Service(name=s, registered=True) s_o.save()