From 1bb6b9f8498e92d7f45aa462efdd497397f033e4 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Tue, 8 Mar 2016 10:16:49 +0000 Subject: [PATCH] Renamed backends to controllers --- TODO.md | 5 +---- orchestra/contrib/databases/backends.py | 6 +++--- .../databases/tests/functional_tests/tests.py | 12 ++++++------ orchestra/contrib/domains/backends.py | 10 +++++----- .../contrib/domains/tests/functional_tests/tests.py | 4 ++-- orchestra/contrib/lists/backends.py | 10 +++++----- .../contrib/lists/tests/functional_tests/tests.py | 2 +- orchestra/contrib/mailboxes/backends.py | 12 ++++++------ .../mailboxes/tests/functional_tests/tests.py | 2 +- .../contrib/orchestration/migrations/0001_initial.py | 2 +- .../migrations/0002_auto_20150506_1420.py | 2 +- .../migrations/0006_auto_20160219_1110.py | 2 +- orchestra/contrib/saas/backends/bscw.py | 2 +- orchestra/contrib/saas/backends/dokuwikimu.py | 4 ++-- orchestra/contrib/saas/backends/drupalmu.py | 4 ++-- orchestra/contrib/saas/backends/gitlab.py | 2 +- orchestra/contrib/saas/backends/moodle.py | 2 +- orchestra/contrib/saas/backends/owncloud.py | 2 +- orchestra/contrib/saas/backends/phplist.py | 2 +- orchestra/contrib/saas/backends/wordpressmu.py | 2 +- orchestra/contrib/systemusers/backends.py | 2 +- orchestra/contrib/webapps/backends/moodle.py | 4 ++-- orchestra/contrib/webapps/backends/php.py | 10 +++++----- orchestra/contrib/webapps/backends/python.py | 4 ++-- orchestra/contrib/webapps/backends/static.py | 2 +- orchestra/contrib/webapps/backends/symboliclink.py | 8 ++++---- orchestra/contrib/webapps/backends/webalizer.py | 2 +- orchestra/contrib/webapps/backends/wordpress.py | 4 ++-- .../contrib/webapps/tests/functional_tests/tests.py | 2 +- orchestra/contrib/websites/backends/apache.py | 10 +++++----- orchestra/contrib/websites/backends/moodle.py | 2 +- orchestra/contrib/websites/backends/webalizer.py | 2 +- orchestra/contrib/websites/backends/wordpress.py | 2 +- .../contrib/websites/tests/functional_tests/tests.py | 6 +++--- 34 files changed, 73 insertions(+), 76 deletions(-) diff --git a/TODO.md b/TODO.md index db6e1a4b..b082725d 100644 --- a/TODO.md +++ b/TODO.md @@ -306,7 +306,7 @@ method( arg, arg, arg) -Bash/Python/PHPBackend +Bash/Python/PHPController # services.handler as generator in order to save memory? not swell like a balloon @@ -431,6 +431,3 @@ mkhomedir_helper or create ssh homes with bash.rc and such # Automatically re-run backends until success? only timedout executions? # TODO save serialized versions ob backendoperation.instance in order to allow backend reexecution of deleted objects - -# Rename Backend -> COntroller - diff --git a/orchestra/contrib/databases/backends.py b/orchestra/contrib/databases/backends.py index 1cd9f3dd..f845c838 100644 --- a/orchestra/contrib/databases/backends.py +++ b/orchestra/contrib/databases/backends.py @@ -8,7 +8,7 @@ from orchestra.contrib.resources import ServiceMonitor from . import settings -class MySQLBackend(ServiceController): +class MySQLController(ServiceController): """ Simple backend for creating MySQL databases using CREATE DATABASE statement. """ @@ -58,7 +58,7 @@ class MySQLBackend(ServiceController): mysql -e 'FLUSH PRIVILEGES;'\ """) ) - super(MySQLBackend, self).commit() + super(MySQLController, self).commit() def get_context(self, database): context = { @@ -68,7 +68,7 @@ class MySQLBackend(ServiceController): return replace(replace(context, "'", '"'), ';', '') -class MySQLUserBackend(ServiceController): +class MySQLUserController(ServiceController): """ Simple backend for creating MySQL users using CREATE USER statement. """ diff --git a/orchestra/contrib/databases/tests/functional_tests/tests.py b/orchestra/contrib/databases/tests/functional_tests/tests.py index ea07c813..c13ad946 100644 --- a/orchestra/contrib/databases/tests/functional_tests/tests.py +++ b/orchestra/contrib/databases/tests/functional_tests/tests.py @@ -135,11 +135,11 @@ class DatabaseTestMixin(object): self.validate_create_table(dbname, username2, password2) -class MySQLBackendMixin(object): +class MySQLControllerMixin(object): db_type = 'mysql' def setUp(self): - super(MySQLBackendMixin, self).setUp() + super(MySQLControllerMixin, self).setUp() # Get local ip address used to reach self.MASTER_SERVER s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect((self.MASTER_SERVER, 22)) @@ -148,11 +148,11 @@ class MySQLBackendMixin(object): def add_route(self): server = Server.objects.create(name=self.MASTER_SERVER) - backend = backends.MySQLBackend.get_name() + backend = backends.MySQLController.get_name() match = "database.type == '%s'" % self.db_type Route.objects.create(backend=backend, match=match, host=server) match = "databaseuser.type == '%s'" % self.db_type - backend = backends.MySQLUserBackend.get_name() + backend = backends.MySQLUserController.get_name() Route.objects.create(backend=backend, match=match, host=server) def validate_create_table(self, name, username, password): @@ -337,9 +337,9 @@ class AdminDatabaseMixin(DatabaseTestMixin): self.admin_delete(user) -class RESTMysqlDatabaseTest(MySQLBackendMixin, RESTDatabaseMixin, BaseLiveServerTestCase): +class RESTMysqlDatabaseTest(MySQLControllerMixin, RESTDatabaseMixin, BaseLiveServerTestCase): pass -class AdminMysqlDatabaseTest(MySQLBackendMixin, AdminDatabaseMixin, BaseLiveServerTestCase): +class AdminMysqlDatabaseTest(MySQLControllerMixin, AdminDatabaseMixin, BaseLiveServerTestCase): pass diff --git a/orchestra/contrib/domains/backends.py b/orchestra/contrib/domains/backends.py index ffa18a4c..80746d7b 100644 --- a/orchestra/contrib/domains/backends.py +++ b/orchestra/contrib/domains/backends.py @@ -12,7 +12,7 @@ from . import settings from .models import Record, Domain -class Bind9MasterDomainBackend(ServiceController): +class Bind9MasterDomainController(ServiceController): """ Bind9 zone and config generation. It auto-discovers slave Bind9 servers based on your routing configuration and NS servers. @@ -33,7 +33,7 @@ class Bind9MasterDomainBackend(ServiceController): @classmethod def is_main(cls, obj): """ work around Domain.top self relationship """ - if super(Bind9MasterDomainBackend, cls).is_main(obj): + if super(Bind9MasterDomainController, cls).is_main(obj): return not obj.top def save(self, domain): @@ -118,7 +118,7 @@ class Bind9MasterDomainBackend(ServiceController): def get_masters_ips(self, domain): ips = list(settings.DOMAINS_MASTERS) if not ips: - ips += self.get_servers(domain, Bind9MasterDomainBackend) + ips += self.get_servers(domain, Bind9MasterDomainController) return OrderedSet(sorted(ips)) def get_slaves(self, domain): @@ -144,7 +144,7 @@ class Bind9MasterDomainBackend(ServiceController): ips.append(addr) # Slaves from internal networks if not settings.DOMAINS_MASTERS: - for server in self.get_servers(domain, Bind9SlaveDomainBackend): + for server in self.get_servers(domain, Bind9SlaveDomainController): ips.append(server) return OrderedSet(sorted(ips)) @@ -171,7 +171,7 @@ class Bind9MasterDomainBackend(ServiceController): return context -class Bind9SlaveDomainBackend(Bind9MasterDomainBackend): +class Bind9SlaveDomainController(Bind9MasterDomainController): """ Generate the configuartion for slave servers It auto-discover the master server based on your routing configuration or you can use diff --git a/orchestra/contrib/domains/tests/functional_tests/tests.py b/orchestra/contrib/domains/tests/functional_tests/tests.py index 3ed2f34f..fbc92478 100644 --- a/orchestra/contrib/domains/tests/functional_tests/tests.py +++ b/orchestra/contrib/domains/tests/functional_tests/tests.py @@ -310,10 +310,10 @@ class Bind9BackendMixin(object): def add_route(self): master = Server.objects.create(name=self.MASTER_SERVER, address=self.MASTER_SERVER_ADDR) - backend = backends.Bind9MasterDomainBackend.get_name() + backend = backends.Bind9MasterDomainController.get_name() Route.objects.create(backend=backend, match=True, host=master) slave = Server.objects.create(name=self.SLAVE_SERVER, address=self.SLAVE_SERVER_ADDR) - backend = backends.Bind9SlaveDomainBackend.get_name() + backend = backends.Bind9SlaveDomainController.get_name() Route.objects.create(backend=backend, match=True, host=slave) diff --git a/orchestra/contrib/lists/backends.py b/orchestra/contrib/lists/backends.py index d32ec796..2873f28d 100644 --- a/orchestra/contrib/lists/backends.py +++ b/orchestra/contrib/lists/backends.py @@ -9,7 +9,7 @@ from . import settings from .models import List -class MailmanVirtualDomainBackend(ServiceController): +class MailmanVirtualDomainController(ServiceController): """ Only syncs virtualdomains used on mailman addresses """ @@ -62,7 +62,7 @@ class MailmanVirtualDomainBackend(ServiceController): service postfix reload fi""") % context ) - super(MailmanVirtualDomainBackend, self).commit() + super(MailmanVirtualDomainController, self).commit() def get_context_files(self): return { @@ -77,10 +77,10 @@ class MailmanVirtualDomainBackend(ServiceController): return replace(context, "'", '"') -class MailmanBackend(MailmanVirtualDomainBackend): +class MailmanController(MailmanVirtualDomainController): """ Mailman 2 backend based on newlist, it handles custom domains. - Includes MailmanVirtualDomainBackend + Includes MailmanVirtualDomainController """ verbose_name = "Mailman" address_suffixes = [ @@ -202,7 +202,7 @@ class MailmanBackend(MailmanVirtualDomainBackend): } def get_banner(self, mail_list): - banner = super(MailmanBackend, self).get_banner() + banner = super(MailmanController, self).get_banner() return '%s %s' % (banner, mail_list.name) def get_context(self, mail_list): diff --git a/orchestra/contrib/lists/tests/functional_tests/tests.py b/orchestra/contrib/lists/tests/functional_tests/tests.py index 01bee755..5ccc6acd 100644 --- a/orchestra/contrib/lists/tests/functional_tests/tests.py +++ b/orchestra/contrib/lists/tests/functional_tests/tests.py @@ -79,7 +79,7 @@ class ListMixin(object): def add_route(self): server = Server.objects.create(name=self.MASTER_SERVER) - backend = backends.MailmanBackend.get_name() + backend = backends.MailmanController.get_name() Route.objects.create(backend=backend, match=True, host=server) def test_add(self): diff --git a/orchestra/contrib/mailboxes/backends.py b/orchestra/contrib/mailboxes/backends.py index 24e2cfb0..773e7661 100644 --- a/orchestra/contrib/mailboxes/backends.py +++ b/orchestra/contrib/mailboxes/backends.py @@ -53,7 +53,7 @@ class SieveFilteringMixin: self.append('chown %(user)s:%(group)s %(filtering_path)s' % context) -class UNIXUserMaildirBackend(SieveFilteringMixin, ServiceController): +class UNIXUserMaildirController(SieveFilteringMixin, ServiceController): """ Assumes that all system users on this servers all mail accounts. If you want to have system users AND mailboxes on the same server you should consider using virtual mailboxes. @@ -149,7 +149,7 @@ class UNIXUserMaildirBackend(SieveFilteringMixin, ServiceController): return context -#class DovecotPostfixPasswdVirtualUserBackend(SieveFilteringMixin, ServiceController): +#class DovecotPostfixPasswdVirtualUserController(SieveFilteringMixin, ServiceController): # """ # WARNING: This backends is not fully implemented # """ @@ -242,7 +242,7 @@ class UNIXUserMaildirBackend(SieveFilteringMixin, ServiceController): # return context -class PostfixAddressVirtualDomainBackend(ServiceController): +class PostfixAddressVirtualDomainController(ServiceController): """ Secondary SMTP server without mailboxes in it, only syncs virtual domains. """ @@ -326,9 +326,9 @@ class PostfixAddressVirtualDomainBackend(ServiceController): return context -class PostfixAddressBackend(PostfixAddressVirtualDomainBackend): +class PostfixAddressController(PostfixAddressVirtualDomainController): """ - Addresses based on Postfix virtual alias domains, includes PostfixAddressVirtualDomainBackend. + Addresses based on Postfix virtual alias domains, includes PostfixAddressVirtualDomainController. """ verbose_name = _("Postfix address") doc_settings = (settings, ( @@ -413,7 +413,7 @@ class PostfixAddressBackend(PostfixAddressVirtualDomainBackend): ) -class AutoresponseBackend(ServiceController): +class AutoresponseController(ServiceController): """ WARNING: not implemented """ diff --git a/orchestra/contrib/mailboxes/tests/functional_tests/tests.py b/orchestra/contrib/mailboxes/tests/functional_tests/tests.py index 57a6bec8..fb37208f 100644 --- a/orchestra/contrib/mailboxes/tests/functional_tests/tests.py +++ b/orchestra/contrib/mailboxes/tests/functional_tests/tests.py @@ -41,7 +41,7 @@ class MailboxMixin(object): server = Server.objects.create(name=self.MASTER_SERVER) backend = backends.PasswdVirtualUserBackend.get_name() Route.objects.create(backend=backend, match=True, host=server) - backend = backends.PostfixAddressBackend.get_name() + backend = backends.PostfixAddressController.get_name() Route.objects.create(backend=backend, match=True, host=server) def add_quota_resource(self): diff --git a/orchestra/contrib/orchestration/migrations/0001_initial.py b/orchestra/contrib/orchestration/migrations/0001_initial.py index b36fed2a..3431fdda 100644 --- a/orchestra/contrib/orchestration/migrations/0001_initial.py +++ b/orchestra/contrib/orchestration/migrations/0001_initial.py @@ -50,7 +50,7 @@ class Migration(migrations.Migration): name='Route', fields=[ ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), - ('backend', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserBackend', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailmanBackend', '[S] Mailman'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PostfixAddressBackend', '[S] Postfix address'), ('uWSGIPythonBackend', '[S] Python uWSGI'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('PhpListSaaSBackend', '[S] phpList SaaS')], max_length=256, verbose_name='backend')), + ('backend', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Controller', '[S] Apache 2'), ('BSCWController', '[S] BSCW SaaS'), ('Bind9MasterDomainController', '[S] Bind9 master domain'), ('Bind9SlaveDomainController', '[S] Bind9 slave domain'), ('DokuWikiMuController', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserController', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuController', '[S] Drupal multisite'), ('GitLabSaaSController', '[S] GitLab SaaS'), ('AutoresponseController', '[S] Mail autoresponse'), ('MailmanController', '[S] Mailman'), ('MySQLController', '[S] MySQL database'), ('MySQLUserController', '[S] MySQL user'), ('PHPController', '[S] PHP FPM/FCGID'), ('PostfixAddressController', '[S] Postfix address'), ('uWSGIPythonController', '[S] Python uWSGI'), ('StaticController', '[S] Static'), ('SymbolicLinkController', '[S] Symbolic link webapp'), ('UNIXUserMaildirController', '[S] UNIX maildir user'), ('UNIXUserController', '[S] UNIX user'), ('WebalizerAppController', '[S] Webalizer App'), ('WebalizerController', '[S] Webalizer Content'), ('WordPressController', '[S] Wordpress'), ('WordpressMuController', '[S] Wordpress multisite'), ('PhpListSaaSController', '[S] phpList SaaS')], max_length=256, verbose_name='backend')), ('match', models.CharField(help_text='Python expression used for selecting the targe host, instance referes to the current object.', default='True', blank=True, max_length=256, verbose_name='match')), ('is_active', models.BooleanField(default=True, verbose_name='active')), ], diff --git a/orchestra/contrib/orchestration/migrations/0002_auto_20150506_1420.py b/orchestra/contrib/orchestration/migrations/0002_auto_20150506_1420.py index 2e65794a..bc029b79 100644 --- a/orchestra/contrib/orchestration/migrations/0002_auto_20150506_1420.py +++ b/orchestra/contrib/orchestration/migrations/0002_auto_20150506_1420.py @@ -29,6 +29,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='route', name='backend', - field=models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserBackend', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailmanBackend', '[S] Mailman'), ('MailmanVirtualDomainBackend', '[S] Mailman virtdomain-only'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PostfixAddressBackend', '[S] Postfix address'), ('PostfixAddressVirtualDomainBackend', '[S] Postfix address virtdomain-only'), ('uWSGIPythonBackend', '[S] Python uWSGI'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('SyncBind9MasterDomainBackend', '[S] Sync Bind9 master domain'), ('SyncBind9SlaveDomainBackend', '[S] Sync Bind9 slave domain'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('PhpListSaaSBackend', '[S] phpList SaaS')], verbose_name='backend', max_length=256), + field=models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Controller', '[S] Apache 2'), ('BSCWController', '[S] BSCW SaaS'), ('Bind9MasterDomainController', '[S] Bind9 master domain'), ('Bind9SlaveDomainController', '[S] Bind9 slave domain'), ('DokuWikiMuController', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserController', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuController', '[S] Drupal multisite'), ('GitLabSaaSController', '[S] GitLab SaaS'), ('AutoresponseController', '[S] Mail autoresponse'), ('MailmanController', '[S] Mailman'), ('MailmanVirtualDomainController', '[S] Mailman virtdomain-only'), ('MySQLController', '[S] MySQL database'), ('MySQLUserController', '[S] MySQL user'), ('PHPController', '[S] PHP FPM/FCGID'), ('PostfixAddressController', '[S] Postfix address'), ('PostfixAddressVirtualDomainController', '[S] Postfix address virtdomain-only'), ('uWSGIPythonController', '[S] Python uWSGI'), ('StaticController', '[S] Static'), ('SymbolicLinkController', '[S] Symbolic link webapp'), ('SyncBind9MasterDomainController', '[S] Sync Bind9 master domain'), ('SyncBind9SlaveDomainController', '[S] Sync Bind9 slave domain'), ('UNIXUserMaildirController', '[S] UNIX maildir user'), ('UNIXUserController', '[S] UNIX user'), ('WebalizerAppController', '[S] Webalizer App'), ('WebalizerController', '[S] Webalizer Content'), ('WordPressController', '[S] Wordpress'), ('WordpressMuController', '[S] Wordpress multisite'), ('PhpListSaaSController', '[S] phpList SaaS')], verbose_name='backend', max_length=256), ), ] diff --git a/orchestra/contrib/orchestration/migrations/0006_auto_20160219_1110.py b/orchestra/contrib/orchestration/migrations/0006_auto_20160219_1110.py index 4a9045ca..80b37905 100644 --- a/orchestra/contrib/orchestration/migrations/0006_auto_20160219_1110.py +++ b/orchestra/contrib/orchestration/migrations/0006_auto_20160219_1110.py @@ -16,7 +16,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='route', name='backend', - field=models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('ApacheTrafficByName', '[M] ApacheTrafficByName'), ('DokuWikiMuTraffic', '[M] DokuWiki MU Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('WordpressMuTraffic', '[M] Wordpress MU Traffic'), ('OwnCloudDiskQuota', '[M] ownCloud SaaS Disk Quota'), ('OwncloudTraffic', '[M] ownCloud SaaS Traffic'), ('PhpListTraffic', '[M] phpList SaaS Traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailScannerSpamRuleBackend', '[S] MailScanner ruleset'), ('MailmanBackend', '[S] Mailman'), ('MailmanVirtualDomainBackend', '[S] Mailman virtdomain-only'), ('MoodleBackend', '[S] Moodle'), ('MoodleWWWRootBackend', '[S] Moodle WWWRoot (required)'), ('MoodleMuBackend', '[S] Moodle multisite'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PangeaProxmoxOVZ', '[S] PangeaProxmoxOVZ'), ('PostfixAddressBackend', '[S] Postfix address'), ('PostfixAddressVirtualDomainBackend', '[S] Postfix address virtdomain-only'), ('PostfixRecipientAccessBackend', '[S] Postfix recipient access'), ('ProxmoxOVZ', '[S] ProxmoxOVZ'), ('uWSGIPythonBackend', '[S] Python uWSGI'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('SyncBind9MasterDomainBackend', '[S] Sync Bind9 master domain'), ('SyncBind9SlaveDomainBackend', '[S] Sync Bind9 slave domain'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressURLBackend', '[S] WordPress URL'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('OwnCloudBackend', '[S] ownCloud SaaS'), ('PhpListSaaSBackend', '[S] phpList SaaS')], max_length=256, verbose_name='backend'), + field=models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('ApacheTrafficByName', '[M] ApacheTrafficByName'), ('DokuWikiMuTraffic', '[M] DokuWiki MU Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('WordpressMuTraffic', '[M] Wordpress MU Traffic'), ('OwnCloudDiskQuota', '[M] ownCloud SaaS Disk Quota'), ('OwncloudTraffic', '[M] ownCloud SaaS Traffic'), ('PhpListTraffic', '[M] phpList SaaS Traffic'), ('Apache2Controller', '[S] Apache 2'), ('BSCWController', '[S] BSCW SaaS'), ('Bind9MasterDomainController', '[S] Bind9 master domain'), ('Bind9SlaveDomainController', '[S] Bind9 slave domain'), ('DokuWikiMuController', '[S] DokuWiki multisite'), ('DrupalMuController', '[S] Drupal multisite'), ('GitLabSaaSController', '[S] GitLab SaaS'), ('AutoresponseController', '[S] Mail autoresponse'), ('MailScannerSpamRuleController', '[S] MailScanner ruleset'), ('MailmanController', '[S] Mailman'), ('MailmanVirtualDomainController', '[S] Mailman virtdomain-only'), ('MoodleController', '[S] Moodle'), ('MoodleWWWRootController', '[S] Moodle WWWRoot (required)'), ('MoodleMuController', '[S] Moodle multisite'), ('MySQLController', '[S] MySQL database'), ('MySQLUserController', '[S] MySQL user'), ('PHPController', '[S] PHP FPM/FCGID'), ('PangeaProxmoxOVZ', '[S] PangeaProxmoxOVZ'), ('PostfixAddressController', '[S] Postfix address'), ('PostfixAddressVirtualDomainController', '[S] Postfix address virtdomain-only'), ('PostfixRecipientAccessController', '[S] Postfix recipient access'), ('ProxmoxOVZ', '[S] ProxmoxOVZ'), ('uWSGIPythonController', '[S] Python uWSGI'), ('StaticController', '[S] Static'), ('SymbolicLinkController', '[S] Symbolic link webapp'), ('SyncBind9MasterDomainController', '[S] Sync Bind9 master domain'), ('SyncBind9SlaveDomainController', '[S] Sync Bind9 slave domain'), ('UNIXUserMaildirController', '[S] UNIX maildir user'), ('UNIXUserController', '[S] UNIX user'), ('WebalizerAppController', '[S] Webalizer App'), ('WebalizerController', '[S] Webalizer Content'), ('WordPressURLController', '[S] WordPress URL'), ('WordPressController', '[S] Wordpress'), ('WordpressMuController', '[S] Wordpress multisite'), ('OwnCloudController', '[S] ownCloud SaaS'), ('PhpListSaaSController', '[S] phpList SaaS')], max_length=256, verbose_name='backend'), ), migrations.AlterField( model_name='server', diff --git a/orchestra/contrib/saas/backends/bscw.py b/orchestra/contrib/saas/backends/bscw.py index ab21e0e6..a5fe95be 100644 --- a/orchestra/contrib/saas/backends/bscw.py +++ b/orchestra/contrib/saas/backends/bscw.py @@ -7,7 +7,7 @@ from orchestra.contrib.orchestration import ServiceController, replace from .. import settings -class BSCWBackend(ServiceController): +class BSCWController(ServiceController): verbose_name = _("BSCW SaaS") model = 'saas.SaaS' default_route_match = "saas.service == 'bscw'" diff --git a/orchestra/contrib/saas/backends/dokuwikimu.py b/orchestra/contrib/saas/backends/dokuwikimu.py index ad3333e8..411ca831 100644 --- a/orchestra/contrib/saas/backends/dokuwikimu.py +++ b/orchestra/contrib/saas/backends/dokuwikimu.py @@ -12,7 +12,7 @@ from . import ApacheTrafficByHost from .. import settings -class DokuWikiMuBackend(ServiceController): +class DokuWikiMuController(ServiceController): """ Creates a DokuWiki site on a DokuWiki multisite installation. """ @@ -79,7 +79,7 @@ class DokuWikiMuBackend(ServiceController): ) def get_context(self, saas): - context = super(DokuWikiMuBackend, self).get_context(saas) + context = super(DokuWikiMuController, self).get_context(saas) domain = saas.get_site_domain() context.update({ 'template': settings.SAAS_DOKUWIKI_TEMPLATE_PATH, diff --git a/orchestra/contrib/saas/backends/drupalmu.py b/orchestra/contrib/saas/backends/drupalmu.py index d97132e4..82d41b80 100644 --- a/orchestra/contrib/saas/backends/drupalmu.py +++ b/orchestra/contrib/saas/backends/drupalmu.py @@ -8,7 +8,7 @@ from orchestra.contrib.orchestration import ServiceController, replace from .. import settings -class DrupalMuBackend(ServiceController): +class DrupalMuController(ServiceController): """ Creates a Drupal site on a Drupal multisite installation """ @@ -38,7 +38,7 @@ class DrupalMuBackend(ServiceController): self.append("rm -fr %(app_path)s" % context) def get_context(self, webapp): - context = super(DrupalMuBackend, self).get_context(webapp) + context = super(DrupalMuController, self).get_context(webapp) context['drupal_path'] = settings.SAAS_DRUPAL_SITES_PATH % context context['drupal_settings'] = os.path.join(context['drupal_path'], 'settings.php') return replace(context, "'", '"') diff --git a/orchestra/contrib/saas/backends/gitlab.py b/orchestra/contrib/saas/backends/gitlab.py index 77b8389a..8efbcffa 100644 --- a/orchestra/contrib/saas/backends/gitlab.py +++ b/orchestra/contrib/saas/backends/gitlab.py @@ -8,7 +8,7 @@ from orchestra.contrib.orchestration import ServiceController from .. import settings -class GitLabSaaSBackend(ServiceController): +class GitLabSaaSController(ServiceController): verbose_name = _("GitLab SaaS") model = 'saas.SaaS' default_route_match = "saas.service == 'gitlab'" diff --git a/orchestra/contrib/saas/backends/moodle.py b/orchestra/contrib/saas/backends/moodle.py index cdda0d92..b6740531 100644 --- a/orchestra/contrib/saas/backends/moodle.py +++ b/orchestra/contrib/saas/backends/moodle.py @@ -8,7 +8,7 @@ from orchestra.contrib.orchestration import ServiceController from .. import settings -class MoodleMuBackend(ServiceController): +class MoodleMuController(ServiceController): """ Creates a Moodle site on a Moodle multisite installation diff --git a/orchestra/contrib/saas/backends/owncloud.py b/orchestra/contrib/saas/backends/owncloud.py index 118fe3c1..f4c6c6c2 100644 --- a/orchestra/contrib/saas/backends/owncloud.py +++ b/orchestra/contrib/saas/backends/owncloud.py @@ -94,7 +94,7 @@ class OwnClouwAPIMixin(object): return ret -class OwnCloudBackend(OwnClouwAPIMixin, ServiceController): +class OwnCloudController(OwnClouwAPIMixin, ServiceController): """ Creates a wordpress site on a WordPress MultiSite installation. diff --git a/orchestra/contrib/saas/backends/phplist.py b/orchestra/contrib/saas/backends/phplist.py index 3b73f6d7..8f4c99ea 100644 --- a/orchestra/contrib/saas/backends/phplist.py +++ b/orchestra/contrib/saas/backends/phplist.py @@ -13,7 +13,7 @@ from orchestra.utils.sys import sshrun from .. import settings -class PhpListSaaSBackend(ServiceController): +class PhpListSaaSController(ServiceController): """ Creates a new phplist instance on a phpList multisite installation. The site is created by means of creating a new database per phpList site, diff --git a/orchestra/contrib/saas/backends/wordpressmu.py b/orchestra/contrib/saas/backends/wordpressmu.py index d310dd5a..76422ad4 100644 --- a/orchestra/contrib/saas/backends/wordpressmu.py +++ b/orchestra/contrib/saas/backends/wordpressmu.py @@ -12,7 +12,7 @@ from . import ApacheTrafficByHost from .. import settings -class WordpressMuBackend(ServiceController): +class WordpressMuController(ServiceController): """ Creates a wordpress site on a WordPress MultiSite installation. diff --git a/orchestra/contrib/systemusers/backends.py b/orchestra/contrib/systemusers/backends.py index 2ba7a3d7..6e844398 100644 --- a/orchestra/contrib/systemusers/backends.py +++ b/orchestra/contrib/systemusers/backends.py @@ -10,7 +10,7 @@ from orchestra.contrib.resources import ServiceMonitor from . import settings -class UNIXUserBackend(ServiceController): +class UNIXUserController(ServiceController): """ Basic UNIX system user/group support based on useradd, usermod, userdel and groupdel. Autodetects and uses ACL if available, for better permission management. diff --git a/orchestra/contrib/webapps/backends/moodle.py b/orchestra/contrib/webapps/backends/moodle.py index 9a14f7ef..81994e54 100644 --- a/orchestra/contrib/webapps/backends/moodle.py +++ b/orchestra/contrib/webapps/backends/moodle.py @@ -10,7 +10,7 @@ from .. import settings from . import WebAppServiceMixin -class MoodleBackend(WebAppServiceMixin, ServiceController): +class MoodleController(WebAppServiceMixin, ServiceController): """ Installs the latest version of Moodle available on download.moodle.org """ @@ -92,7 +92,7 @@ class MoodleBackend(WebAppServiceMixin, ServiceController): ) def get_context(self, webapp): - context = super(MoodleBackend, self).get_context(webapp) + context = super(MoodleController, self).get_context(webapp) contents = webapp.content_set.all() context.update({ 'db_type': 'mysqli', diff --git a/orchestra/contrib/webapps/backends/php.py b/orchestra/contrib/webapps/backends/php.py index 264cfa1f..47f76cbb 100644 --- a/orchestra/contrib/webapps/backends/php.py +++ b/orchestra/contrib/webapps/backends/php.py @@ -11,7 +11,7 @@ from . import WebAppServiceMixin from .. import settings, utils -class PHPBackend(WebAppServiceMixin, ServiceController): +class PHPController(WebAppServiceMixin, ServiceController): """ PHP support for apache-mod-fcgid and php-fpm. It handles switching between these two PHP process management systemes. @@ -139,13 +139,13 @@ class PHPBackend(WebAppServiceMixin, ServiceController): self.append("rm -f %(cmd_options_path)s" % context_copy) def prepare(self): - super(PHPBackend, self).prepare() + super(PHPController, self).prepare() self.append(textwrap.dedent(""" - BACKEND="PHPBackend" + BACKEND="PHPController" echo "$BACKEND" >> /dev/shm/reload.apache2 function coordinate_apache_reload () { - # Coordinate Apache reload with other concurrent backends (e.g. Apache2Backend) + # Coordinate Apache reload with other concurrent backends (e.g. Apache2Controller) is_last=0 counter=0 while ! mv /dev/shm/reload.apache2 /dev/shm/reload.apache2.locked; do @@ -193,7 +193,7 @@ class PHPBackend(WebAppServiceMixin, ServiceController): coordinate_apache_reload """) % context ) - super(PHPBackend, self).commit() + super(PHPController, self).commit() def get_fpm_config(self, webapp, context): options = webapp.type_instance.get_options() diff --git a/orchestra/contrib/webapps/backends/python.py b/orchestra/contrib/webapps/backends/python.py index 9f2cfc86..8c7ee35e 100644 --- a/orchestra/contrib/webapps/backends/python.py +++ b/orchestra/contrib/webapps/backends/python.py @@ -9,7 +9,7 @@ from . import WebAppServiceMixin from .. import settings -class uWSGIPythonBackend(WebAppServiceMixin, ServiceController): +class uWSGIPythonController(WebAppServiceMixin, ServiceController): """ Emperor mode """ @@ -72,7 +72,7 @@ class uWSGIPythonBackend(WebAppServiceMixin, ServiceController): return context def get_context(self, webapp): - context = super(PHPBackend, self).get_context(webapp) + context = super(PHPController, self).get_context(webapp) options = webapp.get_options() context.update({ 'python_version': webapp.type_instance.get_python_version(), diff --git a/orchestra/contrib/webapps/backends/static.py b/orchestra/contrib/webapps/backends/static.py index 7becb8cb..f5173190 100644 --- a/orchestra/contrib/webapps/backends/static.py +++ b/orchestra/contrib/webapps/backends/static.py @@ -5,7 +5,7 @@ from orchestra.contrib.orchestration import ServiceController from . import WebAppServiceMixin -class StaticBackend(WebAppServiceMixin, ServiceController): +class StaticController(WebAppServiceMixin, ServiceController): """ Static web pages. Only creates the webapp dir and leaves the web server the decision to execute CGIs or not. diff --git a/orchestra/contrib/webapps/backends/symboliclink.py b/orchestra/contrib/webapps/backends/symboliclink.py index a5675333..1b43f0de 100644 --- a/orchestra/contrib/webapps/backends/symboliclink.py +++ b/orchestra/contrib/webapps/backends/symboliclink.py @@ -4,12 +4,12 @@ from django.utils.translation import ugettext_lazy as _ from orchestra.contrib.orchestration import ServiceController, replace -from .php import PHPBackend +from .php import PHPController -class SymbolicLinkBackend(PHPBackend, ServiceController): +class SymbolicLinkController(PHPController, ServiceController): """ - Same as PHPBackend but allows you to have the webapps on a directory diferent than the webapps dir. + Same as PHPController but allows you to have the webapps on a directory diferent than the webapps dir. """ verbose_name = _("Symbolic link webapp") model = 'webapps.WebApp' @@ -28,7 +28,7 @@ class SymbolicLinkBackend(PHPBackend, ServiceController): pass def get_context(self, webapp): - context = super(SymbolicLinkBackend, self).get_context(webapp) + context = super(SymbolicLinkController, self).get_context(webapp) context.update({ 'link_path': webapp.data['path'], }) diff --git a/orchestra/contrib/webapps/backends/webalizer.py b/orchestra/contrib/webapps/backends/webalizer.py index 664603ae..d715e983 100644 --- a/orchestra/contrib/webapps/backends/webalizer.py +++ b/orchestra/contrib/webapps/backends/webalizer.py @@ -6,7 +6,7 @@ from . import WebAppServiceMixin # TODO DEPRECATE -class WebalizerAppBackend(WebAppServiceMixin, ServiceController): +class WebalizerAppController(WebAppServiceMixin, ServiceController): """ Needed for cleaning up webalizer main folder when webapp deleteion withou related contents """ diff --git a/orchestra/contrib/webapps/backends/wordpress.py b/orchestra/contrib/webapps/backends/wordpress.py index cc77b694..cbb1641a 100644 --- a/orchestra/contrib/webapps/backends/wordpress.py +++ b/orchestra/contrib/webapps/backends/wordpress.py @@ -11,7 +11,7 @@ from . import WebAppServiceMixin # Based on https://github.com/mtomic/wordpress-install/blob/master/wpinstall.php -class WordPressBackend(WebAppServiceMixin, ServiceController): +class WordPressController(WebAppServiceMixin, ServiceController): """ Installs the latest version of WordPress available on www.wordpress.org It fully configures the wp-config.php (keys included) and sets up the database with initial admin password. @@ -135,7 +135,7 @@ class WordPressBackend(WebAppServiceMixin, ServiceController): self.append("exc('rm -rf %(app_path)s');" % context) def get_context(self, webapp): - context = super(WordPressBackend, self).get_context(webapp) + context = super(WordPressController, self).get_context(webapp) context.update({ 'db_name': webapp.data['db_name'], 'db_user': webapp.data['db_user'], diff --git a/orchestra/contrib/webapps/tests/functional_tests/tests.py b/orchestra/contrib/webapps/tests/functional_tests/tests.py index 0574ae4c..414a2316 100644 --- a/orchestra/contrib/webapps/tests/functional_tests/tests.py +++ b/orchestra/contrib/webapps/tests/functional_tests/tests.py @@ -53,7 +53,7 @@ class WebAppMixin(object): class StaticWebAppMixin(object): - backend = backends.static.StaticBackend + backend = backends.static.StaticController type_value = 'static' token = random_ascii(100) page = ( diff --git a/orchestra/contrib/websites/backends/apache.py b/orchestra/contrib/websites/backends/apache.py index f23fe769..cb3f6198 100644 --- a/orchestra/contrib/websites/backends/apache.py +++ b/orchestra/contrib/websites/backends/apache.py @@ -12,7 +12,7 @@ from .. import settings from ..utils import normurlpath -class Apache2Backend(ServiceController): +class Apache2Controller(ServiceController): """ Apache ≥2.4 backend with support for the following directives: static, location, fpm, fcgid, uwsgi, \ @@ -142,14 +142,14 @@ class Apache2Backend(ServiceController): ) def prepare(self): - super(Apache2Backend, self).prepare() + super(Apache2Controller, self).prepare() # Coordinate apache restart with php backend in order not to overdo it self.append(textwrap.dedent(""" - BACKEND="Apache2Backend" + BACKEND="Apache2Controller" echo "$BACKEND" >> /dev/shm/restart.apache2 function coordinate_apache_reload () { - # Coordinate Apache reload with other concurrent backends (e.g. PHPBackend) + # Coordinate Apache reload with other concurrent backends (e.g. PHPController) is_last=0 counter=0 while ! mv /dev/shm/reload.apache2 /dev/shm/reload.apache2.locked; do @@ -188,7 +188,7 @@ class Apache2Backend(ServiceController): def commit(self): """ reload Apache2 if necessary """ self.append("coordinate_apache_reload") - super(Apache2Backend, self).commit() + super(Apache2Controller, self).commit() def get_directives(self, directive, context): method, args = directive[0], directive[1:] diff --git a/orchestra/contrib/websites/backends/moodle.py b/orchestra/contrib/websites/backends/moodle.py index e9a52380..b44ec5e0 100644 --- a/orchestra/contrib/websites/backends/moodle.py +++ b/orchestra/contrib/websites/backends/moodle.py @@ -3,7 +3,7 @@ import textwrap from orchestra.contrib.orchestration import ServiceController -class MoodleWWWRootBackend(ServiceController): +class MoodleWWWRootController(ServiceController): """ Configures Moodle site WWWRoot, without it Moodle refuses to work. """ diff --git a/orchestra/contrib/websites/backends/webalizer.py b/orchestra/contrib/websites/backends/webalizer.py index 67956cae..63401cec 100644 --- a/orchestra/contrib/websites/backends/webalizer.py +++ b/orchestra/contrib/websites/backends/webalizer.py @@ -8,7 +8,7 @@ from orchestra.contrib.orchestration import ServiceController from .. import settings -class WebalizerBackend(ServiceController): +class WebalizerController(ServiceController): """ Creates webalizer conf file for each time a webalizer webapp is mounted on a website. """ diff --git a/orchestra/contrib/websites/backends/wordpress.py b/orchestra/contrib/websites/backends/wordpress.py index f2668145..90d84460 100644 --- a/orchestra/contrib/websites/backends/wordpress.py +++ b/orchestra/contrib/websites/backends/wordpress.py @@ -3,7 +3,7 @@ import textwrap from orchestra.contrib.orchestration import ServiceController -class WordPressURLBackend(ServiceController): +class WordPressURLController(ServiceController): """ Configures WordPress site URL with associated website domain. """ diff --git a/orchestra/contrib/websites/tests/functional_tests/tests.py b/orchestra/contrib/websites/tests/functional_tests/tests.py index 9fd69da6..61e31786 100644 --- a/orchestra/contrib/websites/tests/functional_tests/tests.py +++ b/orchestra/contrib/websites/tests/functional_tests/tests.py @@ -4,7 +4,7 @@ import socket import requests from orchestra.contrib.domains.models import Domain, Record -from orchestra.contrib.domains.backends import Bind9MasterDomainBackend +from orchestra.contrib.domains.backends import Bind9MasterDomainController from orchestra.contrib.orchestration.models import Server, Route from orchestra.contrib.webapps.tests.functional_tests.tests import StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, PHPFcidWebAppMixin, PHPFPMWebAppMixin from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, save_response_on_error @@ -26,9 +26,9 @@ class WebsiteMixin(WebAppMixin): def add_route(self): super(WebsiteMixin, self).add_route() server = Server.objects.get() - backend = backends.apache.Apache2Backend.get_name() + backend = backends.apache.Apache2Controller.get_name() Route.objects.get_or_create(backend=backend, match=True, host=server) - backend = Bind9MasterDomainBackend.get_name() + backend = Bind9MasterDomainController.get_name() Route.objects.get_or_create(backend=backend, match=True, host=server) def validate_add_website(self, name, domain):