docs: def on_ok(self):
          """ Save changes made to vent.template """
          # ensure user didn't have any syntactical errors
          input_is_good, trimmed_input = self.valid_input(self.edit_space.value)
          if not input_is_good:
              return
          self.edit_space.value = trimmed_input
  
          # get the number of instances and ensure user didn't malform that
          if re.search(r'instances\ *=', self.edit_space.value):
              try:
                  # split out spaces
                  instances_val = re.split(r'instances\ *=\ *',
                                           self.edit_space.value)[1]
                  instances_val = instances_val.split('\n')[0]
                  new_instances = int(re.match(r'\d+$', instances_val).group())
              except AttributeError:
                  npyscreen.notify_confirm("You didn't specify a valid number"
                                           ' for instances.', title='Invalid'
                                           ' instance number')
                  return
              # user can't change instances when configuring new instnaces
              if (self.instance_cfg and
                      self.settings['new_instances'] != new_instances):
                  npyscreen.notify_confirm("You can't change the number of"
                                           ' instnaces while configuring new'
                                           ' instances!', title='Illegal change')
                  return
              # get old number of instances
              try:
                  if 'old_instances' in self.settings:
                      old_instances = self.settings['old_instances']
                  else:
                      settings_dict = json.loads(
                          self.manifest.option(self.section,
                                               'settings')[1])
                      old_instances = int(settings_dict['instances'])
              except Exception:
                  old_instances = 1
          else:
              new_instances = 1
              old_instances = 1
  
          # save changes and update manifest we're looking at with changes
          if self.vent_cfg:
              save_args = {'main_cfg': True,
                           'config_val': self.edit_space.value}
              self.manifest = self.settings['save_configure'](**save_args)[1]
          else:
              save_args = copy.deepcopy(self.tool_identifier)
              save_args.update({'config_val': self.edit_space.value})
              if self.registry_tool:
                  save_args.update({'from_registry': True})
              if self.instance_cfg:
                  save_args.update({'instances': new_instances})
              self.manifest = self.settings['save_configure'](**save_args)[1]
  
          # restart tools, if necessary
          if not self.just_downloaded and not self.instance_cfg:
              restart_kargs = {'main_cfg': self.vent_cfg,
                               'old_val': self.config_val,
                               'new_val': self.edit_space.value}
              if self.vent_cfg:
                  wait_str = 'Restarting tools affected by changes...'
              else:
                  wait_str = 'Restarting this tool with new settings...'
                  restart_kargs.update(self.tool_identifier)
              npyscreen.notify_wait(wait_str,
                                    title='Restarting with changes')
              self.settings['restart_tools'](**restart_kargs)
  
          # start new instances if user wanted to
          if self.instance_cfg and self.settings['start_new']:
              npyscreen.notify_wait('Starting new instances...',
                                    title='Start')
              tool_d = {}
              for i in range(self.settings['old_instances'] + 1,
                             self.settings['new_instances'] + 1):
                  # create section by scrubbing instance number out of names
                  # and adding new instance number
                  i_section = self.section.rsplit(':', 2)
                  i_section[0] = re.sub(r'[0-9]', '', i_section[0]) + str(i)
                  i_section = ':'.join(i_section)
                  t_name = self.manifest.option(i_section, 'name')[1]
                  t_id = {'name': t_name}
                  tool_d.update(self.settings['prep_start'](**t_id)[1])
              if tool_d:
                  self.settings['start_tools'](tool_d)
  
          # prompt user for instance changes, as necessary
          if not self.instance_cfg and not self.vent_cfg:
              if new_instances > old_instances:
                  try:
                      diff = str(new_instances - old_instances)
                      res = npyscreen.notify_yes_no('You will be creating ' +
                                                    diff + ' additional'
                                                    ' instance(s) is that okay?',
                                                    title='Confirm new'
                                                    ' instance(s)')
                      if res:
                          if self.manifest.option(self.section,
                                                  'built')[1] == 'yes':
                              run = npyscreen.notify_yes_no('Do you want to'
                                                            ' start these new'
                                                            ' tools upon'
                                                            ' creation?',
                                                            title='Run new'
                                                            ' instance(s)')
                          else:
                              run = False
                          # get clean name (no instance numbers in it)
                          new_name = self.settings['tool_name']
                          new_name = re.sub(r'[0-9]+$', '', new_name)
                          self.settings['tool_name'] = new_name
                          npyscreen.notify_wait('Pulling up default settings'
                                                ' for ' +
                                                self.settings['tool_name'] +
                                                '...',
                                                title='Gathering settings')
                          Repository(System().manifest)._clone(
                              self.settings['repo'])
                          self.settings['new_instances'] = new_instances
                          self.settings['old_instances'] = old_instances
                          self.settings['start_new'] = run
                          self.settings['new_instance'] = True
                          self.settings['name'] = 'Configure new instance(s)' + \
                              ' for ' + self.settings['tool_name']
                          self.parentApp.addForm('INSTANCEEDITOR' +
                                                 self.settings['tool_name'],
                                                 EditorForm, **self.settings)
                          self.parentApp.change_form('INSTANCEEDITOR' +
                                                     self.settings['tool_name'])
                      else:
                          return
                  except Exception:
                      npyscreen.notify_confirm('Trouble finding tools to add,'
                                               ' exiting', title='Error')
                      self.on_cancel()
              elif new_instances < old_instances:
                  try:
                      diff = str(old_instances - new_instances)
                      res = npyscreen.notify_yes_no('You will be deleting ' +
                                                    diff + ' instance(s), is'
                                                    ' that okay?',
                                                    title='Confirm delete'
                                                    ' instance(s)')
                      if res:
                          form_name = 'Delete instances for ' + \
                              re.sub(r'\d+$', '',
                                     self.settings['tool_name']) + '\t'*8 + \
                              '^E to exit configuration process'
                          clean_section = self.section.rsplit(':', 2)
                          clean_section[0] = re.sub(r'\d+$', '',
                                                    clean_section[0])
                          clean_section = ':'.join(clean_section)
                          d_args = {'name': form_name,
                                    'new_instances': new_instances,
                                    'old_instances': old_instances,
                                    'next_tool': self.settings['next_tool'],
                                    'manifest': self.manifest,
                                    'section': clean_section,
                                    'clean': self.settings['clean'],
                                    'prep_start': self.settings['prep_start'],
                                    'start_tools': self.settings['start_tools']}
                          self.parentApp.addForm('DELETER' +
                                                 self.settings['tool_name'],
                                                 DeleteForm, **d_args)
                          self.parentApp.change_form('DELETER' +
                                                     self.settings['tool_name'])
                  except Exception:
                      npyscreen.notify_confirm('Trouble finding instances to'
                                               ' delete, exiting', title='Error')
                      self.on_cancel()
  
          if (new_instances == old_instances or
                  self.instance_cfg or self.vent_cfg):
              npyscreen.notify_confirm('Done configuring ' +
                                       self.settings['tool_name'],
                                       title='Configurations saved')
              self.change_screens()