Ubuntu Pastebin

Paste from 676680 at Mon, 21 Sep 2015 16:14:28 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import json
from manual_config import *
from flask import Flask, redirect, url_for
import urllib
import urllib2
import pdb

str = None

app = Flask(__name__)

from apiclient import maas_client
 

# using the object can access the maas
maas_access = maas_client.MAASClient(maas_client.MAASOAuth(*APIKEY.split(":")), maas_client.MAASDispatcher(), MAAS_URL)

names = 'test'.decode('utf-8')
emailss = 'test@test.com'.decode('utf-8')
passwds = 'test'.decode('utf-8')
sup = '0'.decode('utf-8')
data = {'username':names, 'email':emailss, 'password':passwds, 'is_superuser': sup}

maas_access.post(u"users/", **data)
Download as text