Add manual trigger script for fedimg.
Better to keep it here than tucked away in /home/fedora/oddshocks/
This commit is contained in:
parent
9c7c61ede8
commit
c0f68910f3
2 changed files with 38 additions and 0 deletions
30
roles/fedimg/files/trigger_upload.py
Normal file
30
roles/fedimg/files/trigger_upload.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
""" Triggers an upload process with the specified raw.xz URL. """
|
||||
|
||||
import logging
|
||||
import logging.config
|
||||
import multiprocessing.pool
|
||||
import sys
|
||||
|
||||
import fedmsg
|
||||
import fedmsg.config
|
||||
|
||||
import fedimg
|
||||
import fedimg.services
|
||||
from fedimg.services.ec2 import EC2Service, EC2ServiceException
|
||||
import fedimg.uploader
|
||||
from fedimg.util import virt_types_from_url
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print 'Usage: trigger_upload.py <rawxz_image_url>'
|
||||
sys.exit(1)
|
||||
|
||||
logging.config.dictConfig(fedmsg.config.load_config()['logging'])
|
||||
log = logging.getLogger('fedmsg')
|
||||
|
||||
upload_pool = multiprocessing.pool.ThreadPool(processes=4)
|
||||
|
||||
url = sys.argv[1]
|
||||
|
||||
fedimg.uploader.upload(upload_pool, [url])
|
|
@ -25,6 +25,14 @@
|
|||
tags:
|
||||
- fedimg
|
||||
|
||||
- name: copy manual trigger script
|
||||
copy: >
|
||||
src=trigger_upload.py
|
||||
dest=/usr/local/bin/trigger_upload.py
|
||||
mode=0755
|
||||
tags:
|
||||
- fedimg
|
||||
|
||||
- name: copy base configuration
|
||||
template: >
|
||||
src=fedimg.cfg dest=/etc/fedimg.cfg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue