Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ./noc collection --install fm.eventclasses fm/collections/eventclasses/Network/PPTP/Account_connected.json
- Installing files
- ERROR:root:UNHANDLED EXCEPTION (2014-03-26 10:02:20.296280)
- Working directory: /opt/noc
- <type 'exceptions.ValueError'>
- need more than 1 value to unpack
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/collection.py (Line: 75)
- Function: load
- 68 """
- 69 path = self.get_collection_path()
- 70 if not os.path.exists(path):
- 71 return
- 72 with open(path) as f:
- 73 reader = csv.reader(f)
- 74 header = reader.next()
- 75 ==> for name, uuid, path, hash in reader:
- 76 mi = CollectionItem(
- 77 name=name, uuid=uuid, path=path, hash=hash)
- 78 self.items[uuid] = mi
- 79
- 80 def save(self):
- 81 self.log("Updating manifest")
- Variables:
- header = ['name', 'uuid', 'path', 'hash']
- path = 'fm/collections/eventclasses/manifest.csv'
- f =
- <closed file 'fm/collections/eventclasses/manifest.csv', mode 'r' at 0x46b6660>
- self = <noc.lib.collection.Collection object at 0x4454e90>
- reader = <_csv.reader object at 0x4543590>
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 199)
- Function: handle_install
- 192 dc.save()
- 193 self.log(" ... done")
- 194
- 195 def handle_install(self, name, files):
- 196 self.log("Installing files")
- 197 d = self.get_collection(name)
- 198 dc = Collection(name, d)
- 199 ==> dc.load()
- 200 for f in files:
- 201 try:
- 202 data = json_decode(read_file(f))
- 203 except ValueError:
- 204 raise CommandError("Unable to parse JSON file: %s" % f)
- 205 dc.install_item(data, load=True)
- Variables:
- files = ('fm/collections/eventclasses/Network/PPTP/Account_connected.json',)
- self = <noc.main.management.commands.collection.Command object at 0x4454990>
- dc = <noc.lib.collection.Collection object at 0x4454e90>
- name = 'fm.eventclasses'
- d = <class 'noc.fm.models.eventclass.EventClass'>
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 137)
- Function: _handle
- 130 if len(args) < 2:
- 131 parts = args[0].split(os.path.sep)
- 132 if parts[1] != "collections":
- 133 raise CommandError("Usage: <collection> <file1> .. <fileN>")
- 134 # Generate collection name from path
- 135 name = "%s.%s" % (parts[0], parts[2])
- 136 args = [name] + list(args)
- 137 ==> return self.handle_install(args[0], args[1:])
- 138 elif options["cmd"] == "remove":
- 139 return self.handle_remove(args[0])
- 140 elif options["cmd"] == "check":
- 141 return self.handle_check()
- 142 elif options["cmd"] == "status":
- 143 return self.handle_status(args[1:])
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x4454990>
- args =
- ('fm.eventclasses',
- 'fm/collections/eventclasses/Network/PPTP/Account_connected.json')
- options =
- {'cmd': 'install',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 117)
- Function: handle
- 110 def log(self, msg):
- 111 if not self.verbose:
- 112 return
- 113 print msg
- 114
- 115 def handle(self, *args, **kwargs):
- 116 try:
- 117 ==> self._handle(*args, **kwargs)
- 118 except CommandError:
- 119 raise
- 120 except:
- 121 error_report()
- 122
- 123 def _handle(self, *args, **options):
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x4454990>
- args =
- ('fm.eventclasses',
- 'fm/collections/eventclasses/Network/PPTP/Account_connected.json')
- kwargs =
- {'cmd': 'install',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement