Example #1
0
 def _edit(self, *args, **kwargs):
     verb = kwargs.get('verb', None)
     installstate_id = None
     self._init_backend()
     self._page.template_name = verb['template']
     self._page.set_action('edit')
     self._page.set_page_value('update_button', True)
     request_data = verb.get('request_data', None)
     if request_data is not None:
         installstate_id = request_data.get('id', None)
     if installstate_id is not None:
         installstate = self._installstate.get(id=installstate_id)
         self._page.set_title(
             'Deployment State of %s' % installstate['hostname'])
         install_methods = installmethods.installmethod_list()
         backendsettings = self._backend_settings.get()
         self._page.add_page_data({
             'entry_id': request_data['id'],
             'installstate': installstate,
             'installmethods': install_methods,
             'backend_settings': backendsettings
         })
         result = self._prepare_output(verb['request_type'], verb[
                                       'request_content_type'], output={
                                       'content': self._page.render()})
         return result
Example #2
0
 def _index(self, *args, **kwargs):
     verb = kwargs.get('verb', None)
     backend_list = backends.backend_list()
     install_methods = installmethods.installmethod_list()
     page = self._prepare_page(verb)
     page.set_title('DC2 Admincenter - Install Method Types - Index')
     page.add_page_data({
         'backendlist': backend_list,
         'installmethods': install_methods
     })
     page.set_action('index')
     result = self._prepare_output(verb['request_type'],
                                   verb['request_content_type'],
                                   output={'content': page.render()})
     return result