linode-cli icon indicating copy to clipboard operation
linode-cli copied to clipboard

linode-cli obj put on windows doesn't seem to support globs

Open rockerBOO opened this issue 3 years ago • 0 comments

I'm trying to sync up files using linode-cli on a windows box (windows-latest) on Azure Pipelines via Windows cmd CLI. But using * on a filename doesn't seem to work. If it passes the actual file string it works fine. The * on linux works fine though.

Using the following script as an example. I have Obj access, secret and token environmental variables set

mkdir \a\b\c

set FILENAME=\a\b\c\Ecogarden_x_y_x.txt
set BUCKET=my-bucket-name-here

echo "yo" > %FILENAME%

ls \a\b\c

pip3 install setuptools
pip3 install linode-cli --upgrade
pip3 install boto

echo "Current Location is %cd%"

echo "Attempting to sync %FILENAME%"

type %FILENAME%

linode-cli obj put  --cluster us-east-1 --acl-public a\b\c\Ecogarden* %BUCKET%

linode-cli obj put  --cluster us-east-1 --acl-public %FILENAME% %BUCKET%
Starting: Command Line Script
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Ecogarden_x_y_x.txt
Requirement already satisfied: setuptools in c:\hostedtoolcache\windows\python\3.9.13\x64\lib\site-packages (58.1.0)
Collecting linode-cli
  Downloading linode_cli-5.23.0-py2.py3-none-any.whl (204 kB)
     -------------------------------------- 204.3/204.3 kB 6.3 MB/s eta 0:00:00
Collecting requests
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ---------------------------------------- 62.8/62.8 kB 3.3 MB/s eta 0:00:00
Collecting PyYAML
  Downloading PyYAML-6.0-cp39-cp39-win_amd64.whl (151 kB)
     -------------------------------------- 151.6/151.6 kB 9.4 MB/s eta 0:00:00
Collecting terminaltables
  Downloading terminaltables-3.1.10-py2.py3-none-any.whl (15 kB)
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
     -------------------------------------- 140.4/140.4 kB 8.1 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ---------------------------------------- 61.5/61.5 kB 3.2 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2022.9.14-py3-none-any.whl (162 kB)
     -------------------------------------- 162.5/162.5 kB 9.5 MB/s eta 0:00:00
Installing collected packages: urllib3, terminaltables, PyYAML, idna, charset-normalizer, certifi, requests, linode-cli
Successfully installed PyYAML-6.0 certifi-2022.9.14 charset-normalizer-2.1.1 idna-3.4 linode-cli-5.23.0 requests-2.28.1 terminaltables-3.1.10 urllib3-1.26.12
Collecting boto
  Downloading boto-2.49.0-py2.py3-none-any.whl (1.4 MB)
     ---------------------------------------- 1.4/1.4 MB 28.7 MB/s eta 0:00:00
Installing collected packages: boto
Successfully installed boto-2.49.0
"Current Location is D:\a\1\s"
"Attempting to sync D:\a\1\s\a\b\c\Ecogarden_x_y_x.txt"
"yo" 
No file a\b\c\Ecogarden*
Ecogarden_x_y_x.txt

 |----------------------------------------------------------------------------------------------------| 0.0%

 |####################################################################################################| 100.0%

Done.
Finishing: Command Line Script

Specifically this is where it says no file found.

No file a\b\c\Ecogarden*

But using the filename, %FILENAME%, it works fine.

This glob works fine on linux for me but not on this Azure Pipeline. Took me awhile to pin this down.

rockerBOO avatar Sep 22 '22 05:09 rockerBOO