Creates the tag with project name and priority

This patch adds to the migration script the feature
to use the priority field from "Launchpad task" to
create a tag to the "Storyboard's Story". So, this
tag will be prefixed with the project and followed
by the task priority.

Ex: project_name-priority, manila-high

Change-Id: I6664a9ca0cdb9fbe265e0f18ab3ae8f879475466
Task: 28146
This commit is contained in:
Camila Moura 2019-03-04 17:06:41 +01:00
parent b476b0ed8f
commit a7d7763d99

@ -66,6 +66,11 @@ class LaunchpadWriter(object):
one first." % (project_name))
sys.exit(1)
def build_priority_tag(self, priority):
"""Writes in the tag, the project name, and your priority."""
priority_tag = '{}-{}'.format(self.project.name, priority)
return self.build_tag(priority_tag)
def write_tags(self, bug):
"""Extracts the tags from a launchpad bug, seeds/loads them in the
StoryBoard database, and returns a list of the corresponding entities.
@ -227,6 +232,9 @@ class LaunchpadWriter(object):
title = title[:97] + '...'
description = bug.title + '\n\n' + description
# Create priority tag
tags.append(self.build_priority_tag(priority))
# Sanity check.
story = {
'id': launchpad_id,