Advertisement
Guest User

Untitled

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