Skip to content

Commit

Permalink
Merge branch 'feature/improvements' into 'master'
Browse files Browse the repository at this point in the history
Feature/improvements

See merge request devops/pycloudsigma!3
  • Loading branch information
miguel-cs committed Nov 10, 2020
2 parents 44849c2 + c5aa34e commit 6f5bfdc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cloudsigma"
version = "0.5"
version = "1.0"
description = "CloudSigma's official python library."
authors = ["CloudSigma AG <dev-support@cloudsigma.com>"]
keywords = ["cloud", "cloudsigma", "api", "cloud", "computing"]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ backports.ssl-match-hostname>=3.4.0.2
configobj>=5.0.6
future>=0.18.2
iso8601>=0.1.12
nose>=1.3.7
pyserial>=3.4
requests>=2.23
simplejson>=3.17.0
six>=1.14.0
websocket-client>=0.57.0
nose>=1.3.7
7 changes: 3 additions & 4 deletions samples/set_ssh_key.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from builtins import oct
import os
import stat

import cloudsigma

Expand All @@ -14,14 +13,14 @@


def get_permission(path):
return oct(os.stat(ssh_path)[stat.ST_MODE])[-4:]
return oct(os.stat(ssh_path).st_mode)[-4:]


if not os.path.isdir(ssh_path):
print('Creating folder %s' % ssh_path)
os.makedirs(ssh_path)

if get_permission(ssh_path) != 0o700:
if get_permission(ssh_path) != '0700':
print('Setting permission for %s' % ssh_path)
os.chmod(ssh_path, 0o700)

Expand All @@ -31,6 +30,6 @@ def get_permission(path):
with open(authorized_keys, 'a') as auth_file:
auth_file.write(ssh_key + '\n')

if get_permission(authorized_keys) != 0o600:
if get_permission(authorized_keys) != '0600':
print('Setting permission for %s' % authorized_keys)
os.chmod(authorized_keys, 0o600)
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
],
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
],
Expand All @@ -48,7 +48,7 @@
pycloudsigma allows you to easily manage your entire infrastructure from within Python.
Creating a server is a simple as:
Creating a server is as simple as:
::
Expand All @@ -60,7 +60,7 @@
For more examples, please visit pycloudsigma_.
For more detailed information about CloudSigma's, please visit the `API documentation <https://zrh.cloudsigma.com/docs/>`_.
For more detailed information about CloudSigma, please visit the `API documentation <https://zrh.cloudsigma.com/docs/>`_.
.. _pycloudsigma: https://github.com/cloudsigma/pycloudsigma/blob/master/README.md
"""
Expand Down
14 changes: 7 additions & 7 deletions src/cloudsigma/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,19 +411,19 @@ class Snapshot(ResourceBase):

def clone(self, uuid, data=None, avoid=None):
"""
Clone a drive.
Clone a snapshot (creates a drive).
:param uuid:
Source drive for the clone.
Source snapshot for the clone.
:param data:
Clone drive options. Refer to API docs for possible options.
Clone snapshot options. Refer to API docs for possible options.
:param avoid:
A list of drive or server uuids to avoid for the clone. Avoid
A list of snapshot or server uuids to avoid for the clone. Avoid
attempts to put the clone on a different physical storage host from
the drives in *avoid*. If a server uuid is in *avoid* it is
internally expanded to the drives attached to the server.
the snapshot in *avoid*. If a server uuid is in *avoid* it is
internally expanded to the snapshots attached to the server.
:return:
Cloned drive definition.
Cloned snapshot definition.
"""
data = data or {}
query_params = {}
Expand Down

0 comments on commit 6f5bfdc

Please sign in to comment.