-1
      -1
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Â526_‘I|¥‰ÓMdœv ©ƒ†ü+=ÂÁ     ‹      Õ•QoÚ0Çßû)<?ìŽ ëÔÖñÔ¤¡Q@”iš¦irbC¬&6²)ûôsH¬*Û4­{òùò÷Ýý.‰�<‹Æ½Ù‡I½™ÝÑäÝëá ‡pà}§Í¢êA·Ù
 ú#ŒpêÜò (ŠfÑij³€ÙR—g]°ÎÈÄ5¹ã˜ž‘ÒGÏIã~EÄI—	:P\Ü#=G WÎJ.ü¹�.Ö2¶´�È!¹6›z	ÚPš‹ÖnßÀ®âJJ Šë3A�ŠÄšoÊ
‚¿�ÍÝÂ°x›´4%.Ek–É…
±ÓKL‰ÌÈš$Ä ­,ÄSwÍ…œcÄ2â�ƒÞø“×�KËÓ”0”1ñ«^8º‡¦#–ìqÍ�×\c:dÖ¡\s9—‚ßVâ[ùåxÀ¨ÒDÂ&F.�Ôj/�xˆšèÌ.™g}á	Rs¨ª$ügÝ`ÉwÍ˜\Oû£Y4˜V-áeˆ}uöî0�0#”C‘4"qÞ[ƒUYž«Ø.¯v[T—mä"u˜"Ô@�*�u®3.Ì!í1Î¦;ë°Ò¥µ[íóF4‚¼¼l�#ô4Œ\³e¨­§Â°RwJêÂÒ?‚øÌV>”Ñ±øF³w�€Õîn±.Žbùkõí?Àz€ô¿â¬ÄÚÿÖ˜Vë‰ �ß8ñ„z4ØŽ!Õ ü
üZQtk       ˆÀ¿Ã654¾ÂÁ Ž    ‹      Õ—QoÚ0Çßû)<?ìœJ5<u¤ÒÐ(E-Ó4MSeb“XMìÈ6dìÓÏÁi¡SÙR­ÕèÓ�Ãß¾û9wŽ	ßD—ÃÙ×é9ø8»ƒéçãÑÀB_‚!BÑ,r?tÛž�Ðù˜Sô*Ë²]m©4»B©É³.ÒFñØ´©¡…Õ3|Â”j-7Ã#AÙ  É¥Ñœ2;o­e+3]ù†å(g¹TëÚ=$$eŠ‹e€¨â+¦*¿"·¦�‚ê0á\ÒuÝæHvÁ™oV®Â¡IÁŠd<hdqÈóh â±Í3"nÛ	_@@23€ßFÃËïV‡LZÍÆ!©b‹|?LN/Ä’³‘Ç5Vsñ˜hrIù‚3ºW|íÄ×üçþ#§‰˜Ž/—b+Eq5–™.ˆe=¶©ÚU9	ýÛn�øÁfLÏ®Î'³htå¶„VKl³ûÇ÷ñ”(&ˆ¸b±±²šÌ…y+æº8½‚:oÅ“Ô@@<ª|ìBf”©]Ü} 1‰Sfóuv7ËßÒêx�^Ë÷[þ;àŸô½ ^0ÿ¥¸²» ¶PD§7B¦-ÅvÐ ¥ Ïëw¼½(öìùôPn´mœ<›'‡Õ¼¾î¢všt�ïõƒÞ‹VXs‚Wyi»ù¦jsòpÜ�§Ó÷Ž„'•¦È–‰%¹óš0x ôƒî�0¸bg›ŸZ/[SOhu)2.lƒ;ûúÚº�å¦«�möluƒ) ½œ×sˆ·þë;œì|™Édm1îÝWø_²•½-AììsôóŸÛ¡áÅÕWîm®ö!r,~‰tÉ»    5   	ˆl–ßi~”Ji?u8 ]¸ËWÒ˜´o�þB g¡àu¿çÅƒh¹ÄÃÂ      	00000023
  B   ˆl–Ðz¾”Šj"Tâ‚À½q¶”Å£�þBô„YÆÊFãt2=+ÀþÆƒq—Å_ŠI|¥�+Wé3ž¯ÅÄ Ü    # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
VPS.net driver
"""

import base64

from libcloud.utils.py3 import b
from libcloud.common.base import JsonResponse, ConnectionUserAndKey
from libcloud.common.types import InvalidCredsError, MalformedResponseError
from libcloud.compute.base import Node, NodeSize, NodeImage, NodeDriver, NodeLocation
from libcloud.compute.types import NodeState
from libcloud.compute.providers import Provider

try:
    import simplejson as json
except ImportError:
    import json


API_HOST = "api.vps.net"
API_VERSION = "api10json"

RAM_PER_NODE = 256
DISK_PER_NODE = 10
BANDWIDTH_PER_NODE = 250


class VPSNetResponse(JsonResponse):
    def parse_body(self):
        try:
            return super().parse_body()
        except MalformedResponseError:
            return self.body

    def success(self):
        # vps.net wrongly uses 406 for invalid auth creds
        if self.status == 406 or self.status == 403:
            raise InvalidCredsError()
        return True

    def parse_error(self):
        try:
            errors = super().parse_body()["errors"][0]
        except MalformedResponseError:
            return self.body
        else:
            return "\n".join(errors)


class VPSNetConnection(ConnectionUserAndKey):
    """
    Connection class for the VPS.net driver
    """

    host = API_HOST
    responseCls = VPSNetResponse

    allow_insecure = False

    def add_default_headers(self, headers):
        user_b64 = base64.b64encode(b("{}:{}".format(self.user_id, self.key)))
        headers["Authorization"] = "Basic %s" % (user_b64.decode("utf-8"))
        return headers


class VPSNetNodeDriver(NodeDriver):
    """
    VPS.net node driver
    """

    type = Provider.VPSNET
    api_name = "vps_net"
    name = "vps.net"
    website = "http://vps.net/"
    connectionCls = VPSNetConnection

    def _to_node(self, vm):
        if vm["runnin