Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File: /opt/noc/main/management/commands/collection.py (Line: 172)
- Function: handle_sync
- 165 DocCategory.fix_all()
- 166 try:
- 167 for name, doc in self.collections:
- 168 lc = Collection(name, doc, local=True)
- 169 lc.load()
- 170 dc = Collection(name, doc)
- 171 dc.load()
- 172 ==> lc.apply(dc)
- 173 except ValueError, why:
- 174 raise CommandError(why)
- 175
- 176 def handle_upgrade(self, collections):
- 177 for c in collections:
- 178 self.log("Upgrading %s" % c)
- Variables:
- doc = <class 'noc.inv.models.objectmodel.ObjectModel'>
- self = <noc.main.management.commands.collection.Command object at 0x39dc610>
- dc = <noc.lib.collection.Collection object at 0x3e26390>
- name = 'inv.objectmodels'
- lc = <noc.lib.collection.Collection object at 0x3e13f50>
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 136)
- Function: _handle
- 129 raise
- 130 except:
- 131 error_report()
- 132
- 133 def _handle(self, *args, **options):
- 134 self.verbose = bool(options.get("verbosity"))
- 135 if options["cmd"] == "sync":
- 136 ==> return self.handle_sync()
- 137 elif options["cmd"] == "upgrade":
- 138 return self.handle_upgrade(args)
- 139 elif options["cmd"] == "install":
- 140 if len(args) < 2:
- 141 parts = args[0].split(os.path.sep)
- 142 if (len(parts) < 2 or parts[1] != "collections"):
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x39dc610>
- args = ()
- options =
- {'cmd': 'sync',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 127)
- Function: handle
- 120 msg = "%s\nAvailable collections:" % msg
- 121 for n, d in self.collections:
- 122 msg = "%s\n %s" % (msg, n)
- 123 return msg
- 124
- 125 def handle(self, *args, **kwargs):
- 126 try:
- 127 ==> self._handle(*args, **kwargs)
- 128 except CommandError:
- 129 raise
- 130 except:
- 131 error_report()
- 132
- 133 def _handle(self, *args, **options):
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x39dc610>
- args = ()
- kwargs =
- {'cmd': 'sync',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
Advertisement
Add Comment
Please, Sign In to add comment