"""Create manual Pipeline for Spinnaker."""
from ..utils.lookups import FileLookup
from .create_pipeline import SpinnakerPipeline


class SpinnakerPipelineManual(SpinnakerPipeline):
    """Manual JSON configured Spinnaker Pipelines."""

    def create_pipeline(self):
        """Use JSON files to create Pipelines."""
        self.log.info('Uploading manual Pipelines: %s')
        lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir)

        for json_file in self.settings['pipeline']['pipeline_files']:
            json_dict = lookup.json(filename=json_file)
            json_dict['name'] = json_file
            self.post_pipeline(json_dict)

        return True

"""Create manual Pipeline for Spinnaker."""
from ..utils.lookups import FileLookup
from .clean_pipelines import delete_pipeline
from .create_pipeline import SpinnakerPipeline


class SpinnakerPipelineManual(SpinnakerPipeline):
    """Manual JSON configured Spinnaker Pipelines."""

    def create_pipeline(self):
        """Use JSON files to create Pipelines."""
        self.log.info('Uploading manual Pipelines: %s')
        lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir)

        for json_file in self.settings['pipeline']['pipeline_files']:
            delete_pipeline(app=self.app_name, pipeline_name=json_file)

            json_dict = lookup.json(filename=json_file)
            json_dict['name'] = json_file
            self.post_pipeline(json_dict)

        return True

Delete manual Pipeline before creating
fix: Delete manual Pipeline before creating

See also: #72

  """Create manual Pipeline for Spinnaker."""
  from ..utils.lookups import FileLookup
+ from .clean_pipelines import delete_pipeline
  from .create_pipeline import SpinnakerPipeline
  
  
  class SpinnakerPipelineManual(SpinnakerPipeline):
      """Manual JSON configured Spinnaker Pipelines."""
  
      def create_pipeline(self):
          """Use JSON files to create Pipelines."""
          self.log.info('Uploading manual Pipelines: %s')
          lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir)
  
          for json_file in self.settings['pipeline']['pipeline_files']:
+             delete_pipeline(app=self.app_name, pipeline_name=json_file)
+ 
              json_dict = lookup.json(filename=json_file)
              json_dict['name'] = json_file
              self.post_pipeline(json_dict)
  
          return True
  
Delete manual Pipeline before creating
## Code Before:
"""Create manual Pipeline for Spinnaker."""
from ..utils.lookups import FileLookup
from .create_pipeline import SpinnakerPipeline


class SpinnakerPipelineManual(SpinnakerPipeline):
    """Manual JSON configured Spinnaker Pipelines."""

    def create_pipeline(self):
        """Use JSON files to create Pipelines."""
        self.log.info('Uploading manual Pipelines: %s')
        lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir)

        for json_file in self.settings['pipeline']['pipeline_files']:
            json_dict = lookup.json(filename=json_file)
            json_dict['name'] = json_file
            self.post_pipeline(json_dict)

        return True

## Instruction:
Delete manual Pipeline before creating
## Code After:
"""Create manual Pipeline for Spinnaker."""
from ..utils.lookups import FileLookup
from .clean_pipelines import delete_pipeline
from .create_pipeline import SpinnakerPipeline


class SpinnakerPipelineManual(SpinnakerPipeline):
    """Manual JSON configured Spinnaker Pipelines."""

    def create_pipeline(self):
        """Use JSON files to create Pipelines."""
        self.log.info('Uploading manual Pipelines: %s')
        lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir)

        for json_file in self.settings['pipeline']['pipeline_files']:
            delete_pipeline(app=self.app_name, pipeline_name=json_file)

            json_dict = lookup.json(filename=json_file)
            json_dict['name'] = json_file
            self.post_pipeline(json_dict)

        return True
