opinkerfi / adagios

Adagios - Web Based Nagios Configuration
GNU Affero General Public License v3.0
327 stars 75 forks source link

unhandled BaseException when "saving" without any changes being made #20

Closed palli closed 12 years ago

palli commented 12 years ago

Environment:

Request Method: POST Request URL: http://localhost:8000/objectbrowser/edit_object/id=616306914500298923

Django Version: 1.3.1 Python Version: 2.7.3 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'adagios.okconfig_', 'adagios.objectbrowser', 'adagios.rest', 'adagios.misc'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware')

Traceback: File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, _callback_args, *_callback_kwargs) File "/home/palli/workspace/adagios/adagios/objectbrowser/views.py" in edit_object
  2. c['form'].save() File "/home/palli/workspace/adagios/adagios/objectbrowser/forms.py" in save
  3. self.pynag_object.save() File "/opt/pynag/pynag/Model/init.py" in save
  4. self._event(level='write', message="%s '%s'." % (self.object_type, self['shortname'] )) File "/opt/pynag/pynag/Model/init.py" in _event
  5. i.write( object_definition=self, message=message ) File "/opt/pynag/pynag/Model/EventHandlers/init.py" in write
  6. self._git_commit(filename, message) File "/opt/pynag/pynag/Model/EventHandlers/init.py" in _git_commit
  7. return self._run_command(command=command) File "/opt/pynag/pynag/Model/EventHandlers/init.py" in _run_command
  8. raise BaseException( errorstring )

Exception Type: BaseException at /objectbrowser/edit_object/id=616306914500298923 Exception Value: Command 'git commit /etc/nagios3/okconfig/hosts/misc/bleh1.example.com-host.cfg -m 'service "bleh1.example.com/Running Processes".'' returned exit status 1. stdout: # On branch master

Changes not staged for commit:

(use "git add/rm ..." to update what will be committed)

(use "git checkout -- ..." to discard changes in working directory)

deleted: okconfig/hosts/default/oldhostname-host.cfg

Untracked files:

(use "git add ..." to include in what will be committed)

okconfig/groups/testgroup.cfg

okconfig/hosts/default/localhost-host.cfg

okconfig/hosts/default/localhost-linux.cfg

okconfig/hosts/misc/bleh1.example.com-drbd.cfg

okconfig/hosts/misc/bleh10.example.com-drbd.cfg

okconfig/hosts/misc/bleh10.example.com-nagios.cfg

okconfig/hosts/misc/bleh100.example.com-nagios.cfg

okconfig/hosts/test.cfg

no changes added to commit (use "git add" and/or "git commit -a")

stderr:

palli commented 12 years ago

fixed in pynag head. Git no longer tries to git commit when no changes have been made.