from __future__ import absolute_import

from flask import current_app

from changes.buildsteps.default import DefaultBuildStep
from changes.utils.http import build_uri


class LXCBuildStep(DefaultBuildStep):
    """
    Similar to the default build step, except that it runs the client using
    the LXC adapter.
    """
    changes_lxc_bin = 'changes-lxc'

    def get_label(self):
        return 'Build via Changes Client (LXC)'

    def get_allocation_command(self, jobstep):
        args = {
            'api_url': build_uri('/api/0/'),
            'jobstep_id': jobstep.id.hex,
            's3_bucket': current_app.config['SNAPSHOT_S3_BUCKET'],
            'pre_launch': current_app.config['LXC_PRE_LAUNCH'],
            'post_launch': current_app.config['LXC_POST_LAUNCH'],
        }
        return "changes-client " \
            "-adapter lxc" \
            "-server %(api_url)s " \
            "-jobstep_id %(jobstep_id)s " \
            "-s3-bucket %(s3_bucket)s " \
            "-pre-launch \"%(pre_launch)s\" " \
            "-post-launch \"%(post_launch)s\"" % args

@@ -318,45 +318,8 @@
 %22%22%22%0A
-    changes_lxc_bin = 'changes-lxc'%0A%0A
     

Remove unused attribute