Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. import createrepo_c as cr
  2.  
  3. module_data = {
  4.  'arch': 'x86_64',
  5.  'name': 'idm',
  6.  'stream': 'DL1',
  7.  'context': '6573b795',
  8.  'version': 8010020191127093529}
  9.  
  10. def create_collection():
  11.     col = cr.UpdateCollection()
  12.     col.shortname = 'short name'
  13.     module = cr.UpdateCollectionModule()
  14.  
  15.     # if you uncomment the pdb and just tell it to continue ('c'), everything will be perfect.
  16.     # without it, values for module attributes are not set
  17. #    import pdb; pdb.set_trace()
  18.     module.name = module_data['name']
  19.     module.stream = module_data['stream']
  20.     module.version = module_data['version']
  21.     module.context = module_data['context']
  22.     module.arch = module_data['arch']
  23.  
  24.     col.module = module
  25.  
  26.     return col
  27.  
  28. c = create_collection()
  29. print(c.module.name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement