Advertisement
Guest User

Untitled

a guest
Oct 29th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.35 KB | None | 0 0
  1. Syncing noc.vendors:
  2. Syncing noc.modelinterfaces:
  3. Syncing noc.connectiontypes:
  4. Syncing noc.objectmodels:
  5. ERROR:root:UNHANDLED EXCEPTION (2013-10-29 23:46:15.943682)
  6. Working directory: /opt/noc
  7. <class 'mongoengine.base.ValidationError'>
  8. Unable to dereference <class 'noc.inv.models.vendor.Vendor'>:526f70977e85c911fa76cfe6
  9. START OF TRACEBACK
  10. ------------------------------------------------------------------------
  11. File: /opt/noc/lib/nosql.py (Line: 103)
  12. Function: __get__
  13. 96 # Dereference DBRefs
  14. 97 if isinstance(value, ObjectId):
  15. 98 v = self.document_type.objects(id=value).first()
  16. 99 if v is not None:
  17. 100 instance._data[self.name] = v
  18. 101 else:
  19. 102 raise ValidationError("Unable to dereference %s:%s" % (
  20. 103 ==> self.document_type, value))
  21. 104 return super(PlainReferenceField, self).__get__(instance, owner)
  22. 105
  23. 106 def to_mongo(self, document):
  24. 107 if isinstance(document, Document):
  25. 108 # We need the id from the saved object to create the DBRef
  26. 109 id_ = document.id
  27. Variables:
  28. owner = <class 'noc.inv.models.objectmodel.ObjectModel'>
  29. instance = <ObjectModel: Cisco | ME3400E | ME34X-PWR-AC>
  30. self = <noc.lib.nosql.PlainReferenceField object at 0x3f41290>
  31. value = ObjectId('526f70977e85c911fa76cfe6')
  32. v = None
  33. ------------------------------------------------------------------------
  34. File: /opt/noc/main/management/commands/sync-collections.py (Line: 120)
  35. Function: sync_item
  36. 113 # Dereference ref_field__field lookups
  37. 114 if "__" in i and not i.startswith("__"):
  38. 115 i, f = i.split("__")
  39. 116 if i not in self.doc._fields:
  40. 117 self.die("Invalid lookup field: %s" % i)
  41. 118 ref = self.doc._fields[i].document_type
  42. 119 v = self.lookup(ref, f, v)
  43. 120 ==> cv = getattr(obj, i)
  44. 121 if cv is None or cv.id != v.id:
  45. 122 changed = True
  46. 123 setattr(obj, i, v)
  47. 124 continue
  48. 125 # Process fields
  49. 126 try:
  50. Variables:
  51. sk = [{'name': 'Cisco | ME3400E | ME34X-PWR-AC'}]
  52. changed = False
  53. obj = <ObjectModel: Cisco | ME3400E | ME34X-PWR-AC>
  54. d =
  55. {'connections': [{'description': 'PSU connect to switch',
  56. 'direction': 'o',
  57. 'gender': 'm',
  58. 'group': '0',
  59. 'name': 'in',
  60. 'type': <ConnectionType: Cisco | ME3400E | PSU>,
  61. 'type__name': 'Cisco | ME3400E | PSU'}],
  62. 'data': {'asset': {'part_no0': 'ME34X-PWR-AC'}},
  63. 'description': 'AC PSU for Cisco ME3400E Series switches',
  64. 'is_builtin': True,
  65. 'name': 'Cisco | ME3400E | ME34X-PWR-AC',
  66. 'vendor__code': 'CISCO'}
  67. f = 'code'
  68. i = 'vendor'
  69. allow_partial = True
  70. dd =
  71. {'description': 'PSU connect to switch',
  72. 'direction': 'o',
  73. 'gender': 'm',
  74. 'group': '0',
  75. 'name': 'in',
  76. 'type': <ConnectionType: Cisco | ME3400E | PSU>,
  77. 'type__name': 'Cisco | ME3400E | PSU'}
  78. created = False
  79. edoc = <class 'noc.inv.models.objectmodel.ObjectModelConnection'>
  80. self =
  81. <noc.main.management.commands.sync-collections.CollectionSync object at 0x4f36cd0>
  82. ii = 'description'
  83. field = <mongoengine.fields.BooleanField object at 0x3f41210>
  84. u = 'name'
  85. vv = 'Cisco | ME3400E | PSU'
  86. v = <Vendor: Cisco Systems>
  87. y = 'PSU connect to switch'
  88. x = 'description'
  89. ref = <class 'noc.inv.models.vendor.Vendor'>
  90. k = {'name': 'Cisco | ME3400E | ME34X-PWR-AC'}
  91. partial = False
  92. ------------------------------------------------------------------------
  93. File: /opt/noc/main/management/commands/sync-collections.py (Line: 197)
  94. Function: sync
  95. 190 self.unique = set()
  96. 191 for index in self.doc._meta["unique_indexes"]:
  97. 192 for f, flag in index:
  98. 193 self.unique.add(f)
  99. 194 # Sync items
  100. 195 retry = []
  101. 196 for d in self.get_data():
  102. 197 ==> item_id, to_retry = self.sync_item(d, True)
  103. 198 try:
  104. 199 self.builtin_ids.remove(item_id)
  105. 200 except KeyError:
  106. 201 pass
  107. 202 if to_retry:
  108. 203 retry += [d]
  109. Variables:
  110. index = [('name', 1)]
  111. retry = []
  112. d =
  113. {'connections': [{'description': 'PSU connect to switch',
  114. 'direction': 'o',
  115. 'gender': 'm',
  116. 'group': '0',
  117. 'name': 'in',
  118. 'type': <ConnectionType: Cisco | ME3400E | PSU>,
  119. 'type__name': 'Cisco | ME3400E | PSU'}],
  120. 'data': {'asset': {'part_no0': 'ME34X-PWR-AC'}},
  121. 'description': 'AC PSU for Cisco ME3400E Series switches',
  122. 'is_builtin': True,
  123. 'name': 'Cisco | ME3400E | ME34X-PWR-AC',
  124. 'vendor__code': 'CISCO'}
  125. f = 'name'
  126. self =
  127. <noc.main.management.commands.sync-collections.CollectionSync object at 0x4f36cd0>
  128. o = <ObjectModel: Huawei | Quidway S5300 | Stack cable>
  129. item_id = '526f70987e85c911fa76d08a'
  130. flag = 1
  131. to_retry = False
  132. ------------------------------------------------------------------------
  133. File: /opt/noc/main/management/commands/sync-collections.py (Line: 267)
  134. Function: handle
  135. 260 if not a:
  136. 261 raise CommandError("Invalid collection: %s" % name)
  137. 262 CollectionSync(*a)
  138. 263 else:
  139. 264 # Sync all collections
  140. 265 for app, collections in self.collections:
  141. 266 for collection, doc in collections:
  142. 267 ==> CollectionSync(app, collection, doc).sync()
  143. 268 except CommandError, why:
  144. 269 raise CommandError(why)
  145. 270 except:
  146. 271 error_report()
  147. Variables:
  148. doc = <class 'noc.inv.models.objectmodel.ObjectModel'>
  149. app = 'inv'
  150. args = ()
  151. collection = 'objectmodels'
  152. self =
  153. <noc.main.management.commands.sync-collections.Command object at 0x4f36910>
  154. collections =
  155. [('vendors', <class 'noc.inv.models.vendor.Vendor'>),
  156. ('modelinterfaces', <class 'noc.inv.models.modelinterface.ModelInterface'>),
  157. ('connectiontypes', <class 'noc.inv.models.connectiontype.ConnectionType'>),
  158. ('objectmodels', <class 'noc.inv.models.objectmodel.ObjectModel'>)]
  159. options =
  160. {'pythonpath': None, 'settings': None, 'traceback': None, 'verbosity': '1'}
  161. ------------------------------------------------------------------------
  162. END OF TRACEBACK
  163. Syncronizing refbooks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement