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

Wrong filenames for files for some usernames with leading zeros in nicknames #246

Closed
lgg opened this issue Feb 17, 2017 · 2 comments
Closed

Comments

@lgg
Copy link

lgg commented Feb 17, 2017

OS / Environment

Ubuntu 16.04, Digital Ocean

Ansible version

ansible 2.2.0.0

Version of components from requirements.txt

dopy 0.3.5
boto 2.45.0
boto3 1.4.4
azure 2.0.0rc5
apache-libcloud 1.5.0
six 1.10.0
pyopenssl 16.1.0
jinja2 2.8

Summary of the problem

See screenshots:
image
image

For some reason some filenames are right: e.g. 009 and 029
and some are wrong: 001 became 1, 004 became 4 and etc

Steps to reproduce the behavior

  • edit config.cfg
  • add users like in screenshot above
  • create mobileconfigs

The way of deployment (cloud or local)

  • git clone this repo
  • ./algo
  • provide Digital Ocean api token

Expected behavior

Mobileconfig files will have the same filenames as their usernames.

Actual behavior

Some mobileconfigs lose leading zeros in their filenames

@lgg lgg changed the title Wrong filenames for .mobileconfigs for some usernames with leading zeros in nicknames Wrong filenames for files for some usernames with leading zeros in nicknames Feb 17, 2017
@lgg
Copy link
Author

lgg commented Feb 17, 2017

The same thing is for all files: .mobileconfig, .p12 and others

@jackivanov
Copy link
Collaborator

Python interprets numbers that start with a zero as octal and converts it to decimal. Escape it

users:
  - '001'
  - '002'
  - '003'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants