Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [11:07:49][root@noc][/usr/local/noc]# ./noc shell
- WARNING: IPython History requires SQLite, your history will not be saved
- Python 2.7.6 (default, May 15 2014, 18:58:42)
- Type "copyright", "credits" or "license" for more information.
- IPython 3.1.0 -- An enhanced Interactive Python.
- ? -> Introduction and overview of IPython's features.
- %quickref -> Quick reference.
- help -> Python's own help system.
- object? -> Details about 'object', use 'object??' for extra details.
- In [1]: from noc.fm.models import *
- In [2]: alarms = ActiveAlarm.objects.filter()
- In [3]: for a in alarms:
- ...: a.clear_alarm("close")
- ...:
- ---------------------------------------------------------------------------
- DatabaseError Traceback (most recent call last)
- /usr/local/noc/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>()
- 1 for a in alarms:
- ----> 2 a.clear_alarm("close")
- 3
- /usr/local/noc/fm/models/activealarm.pyc in clear_alarm(self, message)
- 163 "symptoms": a.alarm_class.symptoms,
- 164 "recommended_actions": a.alarm_class.recommended_actions,
- --> 165 "probable_causes": a.alarm_class.probable_causes
- 166 })
- 167 elif ct:
- /usr/local/noc/sa/models/managedobject.pyc in event(self, event_id, data, delay, tag)
- 539 tag = "alarm:%s" % data["alarm"].id
- 540 NotificationGroup.group_notify(
- --> 541 groups, subject=subject, body=body, delay=delay, tag=tag)
- 542 # Schedule FTS reindex
- 543 if event_id in (
- /usr/local/noc/main/models/notificationgroup.pyc in group_notify(cls, groups, subject, body, link, delay, tag)
- 145 if tag:
- 146 n.tag = tag
- --> 147 n.save()
- 148
- 149
- /usr/local/noc/lib/python2.7/site-packages/django/db/models/base.pyc in save(self, force_insert, force_update, using)
- 461 if force_insert and force_update:
- 462 raise ValueError("Cannot force both insert and updating in model saving.")
- --> 463 self.save_base(using=using, force_insert=force_insert, force_update=force_update)
- 464
- 465 save.alters_data = True
- /usr/local/noc/lib/python2.7/site-packages/django/db/models/base.pyc in save_base(self, raw, cls, origin, force_insert, force_update, using)
- 549
- 550 update_pk = bool(meta.has_auto_field and not pk_set)
- --> 551 result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
- 552
- 553 if update_pk:
- /usr/local/noc/lib/python2.7/site-packages/django/db/models/manager.pyc in _insert(self, objs, fields, **kwargs)
- 201
- 202 def _insert(self, objs, fields, **kwargs):
- --> 203 return insert_query(self.model, objs, fields, **kwargs)
- 204
- 205 def _update(self, values, **kwargs):
- /usr/local/noc/lib/python2.7/site-packages/django/db/models/query.pyc in insert_query(model, objs, fields, return_id, raw, using)
- 1591 query = sql.InsertQuery(model)
- 1592 query.insert_values(fields, objs, raw=raw)
- -> 1593 return query.get_compiler(using=using).execute_sql(return_id)
- 1594
- 1595
- /usr/local/noc/lib/python2.7/site-packages/django/db/models/sql/compiler.pyc in execute_sql(self, return_id)
- 910 cursor = self.connection.cursor()
- 911 for sql, params in self.as_sql():
- --> 912 cursor.execute(sql, params)
- 913 if not (return_id and cursor):
- 914 return
- /usr/local/noc/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.pyc in execute(self, query, args)
- 50 def execute(self, query, args=None):
- 51 try:
- ---> 52 return self.cursor.execute(query, args)
- 53 except Database.IntegrityError, e:
- 54 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
- DatabaseError: value too long for type character varying(256)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement