Quellcode durchsuchen

A couple of updates missed in the previous two commits... + docs

Enis Afgan vor 9 Jahren
Ursprung
Commit
456634b7ca
3 geänderte Dateien mit 11 neuen und 27 gelöschten Zeilen
  1. 3 3
      .travis.yml
  2. 3 20
      cloudbridge/cloud/providers/openstack/resources.py
  3. 5 4
      docs/topics/launch.rst

+ 3 - 3
.travis.yml

@@ -1,11 +1,11 @@
 language: python
-python: 3.5
+python: 3.6
 os:
   - linux
 #  - osx
 env:
   - TOX_ENV=py27
-  - TOX_ENV=py35
+  - TOX_ENV=py36
   - TOX_ENV=pypy
 matrix:
   fast_finish: true
@@ -19,4 +19,4 @@ script:
   - tox -e $TOX_ENV
 after_success:
   - coveralls
-  - codecov 
+  - codecov

+ 3 - 20
cloudbridge/cloud/providers/openstack/resources.py

@@ -1035,9 +1035,7 @@ class OpenStackBucketObject(BaseBucketObject):
 
     @property
     def name(self):
-        """
-        Get this object's name.
-        """
+        """Get this object's name."""
         return self._obj.get("name")
 
     @property
@@ -1049,10 +1047,7 @@ class OpenStackBucketObject(BaseBucketObject):
         return self._obj.get("last_modified")
 
     def iter_content(self):
-        """
-        Returns this object's content as an
-        iterable.
-        """
+        """Returns this object's content as an iterable."""
         _, content = self._provider.swift.get_object(
             self.cbcontainer.name, self.name, resp_chunk_size=65536)
         return content
@@ -1068,18 +1063,6 @@ class OpenStackBucketObject(BaseBucketObject):
     def upload_from_file(self, path):
         """
         Stores the contents of the file pointed by the "path" variable.
-        :param path: Absolute path to the file to be uploaded to S3.
-        :return: void
-        """
-        raise NotImplementedError("This functionality is not implemented yet.")
-
-    def upload_from_large_file(self, path):
-        """
-        Stores the contents of the large file pointed by the "path" variable.
-        This function split the file in smaller chunks, and uploads chunks
-        in turn.
-        :param path: Absolute path to the large file to be uploaded to S3.
-        :return: void
         """
         raise NotImplementedError("This functionality is not implemented yet.")
 
@@ -1087,7 +1070,7 @@ class OpenStackBucketObject(BaseBucketObject):
         """
         Delete this object.
 
-        :rtype: bool
+        :rtype: ``bool``
         :return: True if successful
         """
         try:

+ 5 - 4
docs/topics/launch.rst

@@ -14,7 +14,7 @@ and 4 GB RAM.
 
 .. code-block:: python
 
-    img = provider.compute.images.get('ami-5ac2cd4d')  # Ubuntu 14.04 on AWS
+    img = provider.compute.images.get('ami-f4cc1de2')  # Ubuntu 16.04 on AWS
     inst_type = sorted([t for t in provider.compute.instance_types.list()
                         if t.vcpus >= 2 and t.ram >= 4],
                        key=lambda x: x.vcpus*x.ram)[0]
@@ -45,16 +45,17 @@ Private networking
 ~~~~~~~~~~~~~~~~~~
 Private networking gives you control over the networking setup for your
 instance(s) and is considered the preferred method for launching instances. To
-launch an instance with an explicit private network, just supply it as an
-additional argument to the ``create`` method:
+launch an instance with an explicit private network, supply a subnet within
+a network as an additional argument to the ``create`` method:
 
 .. code-block:: python
 
     provider.network.list()  # Find a desired network ID
     net = provider.network.get('desired network ID')
+    sn = net.subnets()[0]  # Get a handle on the desired subnet to launch with
     inst = provider.compute.instances.create(
         name='CloudBridge-VPC', image=img, instance_type=inst_type,
-        network=net, key_pair=kp, security_groups=[sg])
+        subnet=sn, key_pair=kp, security_groups=[sg])
 
 For more information on how to create and setup a private network, take a look
 at `Networking <./networking.html>`_.