You can make this method simpler and shorter with what we do in the AppScale Tools and Infrastructure Manager if you like:

```
newstr = str(uuid.uuid4()).replace('-', '')[:10]
```