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-210) Relative paths may cause issues in `aria service-templates` commands
Date Tue, 09 May 2017 14:10:04 GMT

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

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

Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115499156
  
    --- Diff: tests/cli/test_service_templates.py ---
    @@ -131,6 +133,18 @@ def test_store_no_exception(self, monkeypatch, mock_object):
             assert 'Service template {name} stored'.format(
                 name=mock_models.SERVICE_TEMPLATE_NAME) in self.logger_output_string
     
    +    def test_store_relative_path_single_yaml_file(self, monkeypatch, mock_object):
    +        monkeypatch.setattr(Core, 'create_service_template', mock_object)
    +        monkeypatch.setattr(os.path, 'isfile', lambda x: True)
    +        monkeypatch.setattr(service_template_utils, '_is_archive', lambda x: False)
    +
    +        self.invoke('service_templates store service_template.yaml {name}'.format(
    +            name=mock_models.SERVICE_TEMPLATE_NAME))
    +
    +        mock_object.assert_called_with(os.path.join(os.getcwd(), 'service_template.yaml'),
    --- End diff --
    
    just curious why you've decided to use `join` and `getcwd` here rather than absolute path
(like you did in the actual code). not that it should matter :)


> Relative paths may cause issues in `aria service-templates` commands
> --------------------------------------------------------------------
>
>                 Key: ARIA-210
>                 URL: https://issues.apache.org/jira/browse/ARIA-210
>             Project: AriaTosca
>          Issue Type: Bug
>            Reporter: Ran Ziv
>            Assignee: Avia Efrat
>
> The CLI commands {{aria service-templates store}} and {{aria service-templates create-archive}}
use the {{os.path.dirname}} method to get the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already in the
directory of the main service-template file and passes the file directly (e.g. {{aria service-templates
store service-template.yaml my-service-template}})) - It'll fail when trying to copy the service-template's
resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an error claiming
the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message