ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARIA-34) API for rendering a downloaded resource
Date Thu, 05 Jan 2017 13:58:58 GMT

    [ https://issues.apache.org/jira/browse/ARIA-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15801407#comment-15801407
] 

ASF GitHub Bot commented on ARIA-34:
------------------------------------

Github user dankilman commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/41#discussion_r94770916
  
    --- Diff: aria/orchestrator/context/common.py ---
    @@ -97,19 +99,49 @@ def download_resource(self, destination, path=None):
             Download a blueprint resource from the resource storage
             """
             try:
    -            return self.resource.deployment.download(entry_id=self.deployment.id,
    -                                                     destination=destination,
    -                                                     path=path)
    +            self.resource.deployment.download(entry_id=str(self.deployment.id),
    +                                              destination=destination,
    +                                              path=path)
             except exceptions.StorageError:
    -            return self.resource.blueprint.download(entry_id=self.blueprint.id,
    -                                                    destination=destination,
    -                                                    path=path)
    +            self.resource.blueprint.download(entry_id=str(self.blueprint.id),
    +                                             destination=destination,
    +                                             path=path)
    +
    +    def download_resource_and_render(self, destination, path=None, variables=None):
    +        """
    +        Download a blueprint resource from the resource storage render its content as
a jinja
    +        template using the provided variables. ctx is available to the template without
providing it
    +        explicitly.
    +        """
    +        self.download_resource(destination=destination, path=path)
    +        with open(destination, 'rb') as f:
    --- End diff --
    
    on windows, omitting the `b` will cause newlines to be written as CRLF regardless of how
they were originally. So it is definitely required for `wb`. The `rb` is for consistency


> API for rendering a downloaded resource
> ---------------------------------------
>
>                 Key: ARIA-34
>                 URL: https://issues.apache.org/jira/browse/ARIA-34
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Ran Ziv
>            Assignee: Dan Kilman
>
> Add an API for downloading + rendering a resource from the storage, similar to the workflow-context's
"download_resource" method



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message