Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Upload path #115

Open
jaredAtVertex opened this issue Apr 6, 2020 · 1 comment
Open

Issue with Upload path #115

jaredAtVertex opened this issue Apr 6, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@jaredAtVertex
Copy link

jaredAtVertex commented Apr 6, 2020

This line is preventing files from being uploaded to the proper nexus path when running in windows environment: api/repository/upload.py
22 dst_dir = os.path.normpath(dst_dir or REMOTE_PATH_SEPARATOR)

Removing this line yields expected results, but recognize this line was introduced with b2f1321

To re-create this issue:

import os
from pathlib import PurePosixPath

from nexuscli import nexus_config, nexus_client
from nexuscli.api import repository
from nexuscli.api.repository import upload
...

def ul_nexus_asset(env_dtl, component, file_name):
    client = instantiate_nexus_client()
    repo = client.repositories.get_by_name("my-nexus-repo")
    dst = str(PurePosixPath("my_root/{}/{}".format(env_dtl, component)))

    files_uploaded = repository.upload.upload_file_raw(repo, str(file_name), dst, file_name.name)

def instantiate_nexus_client():
    config = nexus_config.NexusConfig(url=NEXUS_URL,
                                      username='someuser',
                                      password='z@nyPa$sword')
    client = nexus_client.NexusClient(config=config)
    client.repositories.refresh()
    return client

uploaded file will get uploaded but does not upload to a directory:
In nexus the component group is created as
/my_root \ environ \ component
instead of
/my_root / environ / component (which is what get's created when you upload a component directly in nexus)

@thiagofigueiro
Copy link
Owner

thiagofigueiro commented Apr 10, 2020

edit: mixed-up my comments

@thiagofigueiro thiagofigueiro added the bug Something isn't working label Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants