from nodeconductor.core import NodeConductorExtension


class ExchangeExtension(NodeConductorExtension):

    @staticmethod
    def django_app():
        return 'nodeconductor_saltstack.exchange'

    @staticmethod
    def rest_urls():
        from .urls import register_in
        return register_in

from nodeconductor.core import NodeConductorExtension


class ExchangeExtension(NodeConductorExtension):

    @staticmethod
    def django_app():
        return 'nodeconductor_saltstack.exchange'

    @staticmethod
    def rest_urls():
        from .urls import register_in
        return register_in

    @staticmethod
    def celery_tasks():
        from datetime import timedelta
        return {
            'exchange-sync-quotas': {
                'task': 'nodeconductor.exchange.sync_quotas',
                'schedule': timedelta(hours=1),
                'args': ()
            },
        }

Add sync quota task to celerybeat
Add sync quota task to celerybeat

 - nc-1009

  from nodeconductor.core import NodeConductorExtension
  
  
  class ExchangeExtension(NodeConductorExtension):
  
      @staticmethod
      def django_app():
          return 'nodeconductor_saltstack.exchange'
  
      @staticmethod
      def rest_urls():
          from .urls import register_in
          return register_in
  
+     @staticmethod
+     def celery_tasks():
+         from datetime import timedelta
+         return {
+             'exchange-sync-quotas': {
+                 'task': 'nodeconductor.exchange.sync_quotas',
+                 'schedule': timedelta(hours=1),
+                 'args': ()
+             },
+         }
+ 
Add sync quota task to celerybeat
## Code Before:
from nodeconductor.core import NodeConductorExtension


class ExchangeExtension(NodeConductorExtension):

    @staticmethod
    def django_app():
        return 'nodeconductor_saltstack.exchange'

    @staticmethod
    def rest_urls():
        from .urls import register_in
        return register_in

## Instruction:
Add sync quota task to celerybeat
## Code After:
from nodeconductor.core import NodeConductorExtension


class ExchangeExtension(NodeConductorExtension):

    @staticmethod
    def django_app():
        return 'nodeconductor_saltstack.exchange'

    @staticmethod
    def rest_urls():
        from .urls import register_in
        return register_in

    @staticmethod
    def celery_tasks():
        from datetime import timedelta
        return {
            'exchange-sync-quotas': {
                'task': 'nodeconductor.exchange.sync_quotas',
                'schedule': timedelta(hours=1),
                'args': ()
            },
        }
