Guest User

Untitled

a guest
Apr 25th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. File: /opt/noc/main/management/commands/collection.py (Line: 172)
  2. Function: handle_sync
  3. 165 DocCategory.fix_all()
  4. 166 try:
  5. 167 for name, doc in self.collections:
  6. 168 lc = Collection(name, doc, local=True)
  7. 169 lc.load()
  8. 170 dc = Collection(name, doc)
  9. 171 dc.load()
  10. 172 ==> lc.apply(dc)
  11. 173 except ValueError, why:
  12. 174 raise CommandError(why)
  13. 175
  14. 176 def handle_upgrade(self, collections):
  15. 177 for c in collections:
  16. 178 self.log("Upgrading %s" % c)
  17. Variables:
  18. doc = <class 'noc.inv.models.objectmodel.ObjectModel'>
  19. self = <noc.main.management.commands.collection.Command object at 0x39dc610>
  20. dc = <noc.lib.collection.Collection object at 0x3e26390>
  21. name = 'inv.objectmodels'
  22. lc = <noc.lib.collection.Collection object at 0x3e13f50>
  23. ------------------------------------------------------------------------
  24. File: /opt/noc/main/management/commands/collection.py (Line: 136)
  25. Function: _handle
  26. 129 raise
  27. 130 except:
  28. 131 error_report()
  29. 132
  30. 133 def _handle(self, *args, **options):
  31. 134 self.verbose = bool(options.get("verbosity"))
  32. 135 if options["cmd"] == "sync":
  33. 136 ==> return self.handle_sync()
  34. 137 elif options["cmd"] == "upgrade":
  35. 138 return self.handle_upgrade(args)
  36. 139 elif options["cmd"] == "install":
  37. 140 if len(args) < 2:
  38. 141 parts = args[0].split(os.path.sep)
  39. 142 if (len(parts) < 2 or parts[1] != "collections"):
  40. Variables:
  41. self = <noc.main.management.commands.collection.Command object at 0x39dc610>
  42. args = ()
  43. options =
  44. {'cmd': 'sync',
  45. 'pythonpath': None,
  46. 'settings': None,
  47. 'traceback': None,
  48. 'verbosity': '1'}
  49. ------------------------------------------------------------------------
  50. File: /opt/noc/main/management/commands/collection.py (Line: 127)
  51. Function: handle
  52. 120 msg = "%s\nAvailable collections:" % msg
  53. 121 for n, d in self.collections:
  54. 122 msg = "%s\n %s" % (msg, n)
  55. 123 return msg
  56. 124
  57. 125 def handle(self, *args, **kwargs):
  58. 126 try:
  59. 127 ==> self._handle(*args, **kwargs)
  60. 128 except CommandError:
  61. 129 raise
  62. 130 except:
  63. 131 error_report()
  64. 132
  65. 133 def _handle(self, *args, **options):
  66. Variables:
  67. self = <noc.main.management.commands.collection.Command object at 0x39dc610>
  68. args = ()
  69. kwargs =
  70. {'cmd': 'sync',
  71. 'pythonpath': None,
  72. 'settings': None,
  73. 'traceback': None,
  74. 'verbosity': '1'}
Advertisement
Add Comment
Please, Sign In to add comment