Project

Profile

Help

Issue #972 ยป do-not-recreate-indexes-by-default.patch

jluza, 05/11/2015 02:30 PM

View differences:

server/pulp/server/db/manage.py
47 47
    parser.add_option('--dry-run', action='store_true', dest='dry_run', default=False,
48 48
                      help=_('Perform a dry run with no changes made. Returns 1 if there are '
49 49
                             'migrations to apply.'))
50
    parser.add_option('--load-content-types', action='store_true', dest='load_content_types',
51
                      default=False, help=_('Load content types.  WARNING: THIS WILL CAUSE INDEXES TO BE REBUILT'))
52

  
50 53
    options, args = parser.parse_args()
51 54
    if args:
52 55
        parser.error(_('Unknown arguments: %s') % ', '.join(args))
......
181 184
    message = _('Loading content types.')
182 185
    _logger.info(message)
183 186
    # Note that if dry_run is False, None is always returned
184
    old_content_types = load_content_types(dry_run=options.dry_run)
187
    old_contnet_types = None
188
    if options.load_content_types:
189
        old_content_types = load_content_types(dry_run=options.dry_run)
185 190
    if old_content_types:
186 191
        for content_type in old_content_types:
187 192
            message = _(
    (1-1/1)