Add worker command state enforcement conforming and verification callback

This commit is contained in:
allegroai 2020-05-09 19:42:51 +03:00
parent 06bfea80bc
commit 38e02ca5cd

View File

@ -94,9 +94,20 @@ class ServiceCommandSection(BaseCommandSection):
def __init__(self, *args, **kwargs):
super(ServiceCommandSection, self).__init__()
kwargs = self._verify_command_states(kwargs)
self._session = self._get_session(*args, **kwargs)
self._list_formatter = ListFormatter(self.service)
@classmethod
def _verify_command_states(cls, kwargs):
"""
Conform and enforce command argument
This is where you can automatically turn on/off switches based on different states.
:param kwargs:
:return: kwargs
"""
return kwargs
@staticmethod
def _get_session(*args, **kwargs):
return Session(*args, **kwargs)