Advertisement
Guest User

Untitled

a guest
Mar 26th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. ./noc collection --install fm.eventclasses fm/collections/eventclasses/Network/PPTP/Account_connected.json
  2. Installing files
  3. ERROR:root:UNHANDLED EXCEPTION (2014-03-26 10:02:20.296280)
  4. Working directory: /opt/noc
  5. <type 'exceptions.ValueError'>
  6. need more than 1 value to unpack
  7. START OF TRACEBACK
  8. ------------------------------------------------------------------------
  9. File: /opt/noc/lib/collection.py (Line: 75)
  10. Function: load
  11. 68 """
  12. 69 path = self.get_collection_path()
  13. 70 if not os.path.exists(path):
  14. 71 return
  15. 72 with open(path) as f:
  16. 73 reader = csv.reader(f)
  17. 74 header = reader.next()
  18. 75 ==> for name, uuid, path, hash in reader:
  19. 76 mi = CollectionItem(
  20. 77 name=name, uuid=uuid, path=path, hash=hash)
  21. 78 self.items[uuid] = mi
  22. 79
  23. 80 def save(self):
  24. 81 self.log("Updating manifest")
  25. Variables:
  26. header = ['name', 'uuid', 'path', 'hash']
  27. path = 'fm/collections/eventclasses/manifest.csv'
  28. f =
  29. <closed file 'fm/collections/eventclasses/manifest.csv', mode 'r' at 0x46b6660>
  30. self = <noc.lib.collection.Collection object at 0x4454e90>
  31. reader = <_csv.reader object at 0x4543590>
  32. ------------------------------------------------------------------------
  33. File: /opt/noc/main/management/commands/collection.py (Line: 199)
  34. Function: handle_install
  35. 192 dc.save()
  36. 193 self.log(" ... done")
  37. 194
  38. 195 def handle_install(self, name, files):
  39. 196 self.log("Installing files")
  40. 197 d = self.get_collection(name)
  41. 198 dc = Collection(name, d)
  42. 199 ==> dc.load()
  43. 200 for f in files:
  44. 201 try:
  45. 202 data = json_decode(read_file(f))
  46. 203 except ValueError:
  47. 204 raise CommandError("Unable to parse JSON file: %s" % f)
  48. 205 dc.install_item(data, load=True)
  49. Variables:
  50. files = ('fm/collections/eventclasses/Network/PPTP/Account_connected.json',)
  51. self = <noc.main.management.commands.collection.Command object at 0x4454990>
  52. dc = <noc.lib.collection.Collection object at 0x4454e90>
  53. name = 'fm.eventclasses'
  54. d = <class 'noc.fm.models.eventclass.EventClass'>
  55. ------------------------------------------------------------------------
  56. File: /opt/noc/main/management/commands/collection.py (Line: 137)
  57. Function: _handle
  58. 130 if len(args) < 2:
  59. 131 parts = args[0].split(os.path.sep)
  60. 132 if parts[1] != "collections":
  61. 133 raise CommandError("Usage: <collection> <file1> .. <fileN>")
  62. 134 # Generate collection name from path
  63. 135 name = "%s.%s" % (parts[0], parts[2])
  64. 136 args = [name] + list(args)
  65. 137 ==> return self.handle_install(args[0], args[1:])
  66. 138 elif options["cmd"] == "remove":
  67. 139 return self.handle_remove(args[0])
  68. 140 elif options["cmd"] == "check":
  69. 141 return self.handle_check()
  70. 142 elif options["cmd"] == "status":
  71. 143 return self.handle_status(args[1:])
  72. Variables:
  73. self = <noc.main.management.commands.collection.Command object at 0x4454990>
  74. args =
  75. ('fm.eventclasses',
  76. 'fm/collections/eventclasses/Network/PPTP/Account_connected.json')
  77. options =
  78. {'cmd': 'install',
  79. 'pythonpath': None,
  80. 'settings': None,
  81. 'traceback': None,
  82. 'verbosity': '1'}
  83. ------------------------------------------------------------------------
  84. File: /opt/noc/main/management/commands/collection.py (Line: 117)
  85. Function: handle
  86. 110 def log(self, msg):
  87. 111 if not self.verbose:
  88. 112 return
  89. 113 print msg
  90. 114
  91. 115 def handle(self, *args, **kwargs):
  92. 116 try:
  93. 117 ==> self._handle(*args, **kwargs)
  94. 118 except CommandError:
  95. 119 raise
  96. 120 except:
  97. 121 error_report()
  98. 122
  99. 123 def _handle(self, *args, **options):
  100. Variables:
  101. self = <noc.main.management.commands.collection.Command object at 0x4454990>
  102. args =
  103. ('fm.eventclasses',
  104. 'fm/collections/eventclasses/Network/PPTP/Account_connected.json')
  105. kwargs =
  106. {'cmd': 'install',
  107. 'pythonpath': None,
  108. 'settings': None,
  109. 'traceback': None,
  110. 'verbosity': '1'}
  111. ------------------------------------------------------------------------
  112. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement