Revision 9c0ac5af

b/fabfile.py
42 42
env.project_root = "./"
43 43
env.develop = False
44 44
env.autoremove = True
45
env.packages = ['snf-common', 'snf-app', 'snf-cyclades-gtools', 'snf-webproject',
45
env.packages = ['snf-common', 'snf-cyclades-app', 'snf-cyclades-gtools', 'snf-webproject',
46 46
                'snf-okeanos-site']
47 47
env.capture = False
48 48
env.colors = True
......
169 169
#
170 170

  
171 171
env.debian_branch = 'debian-0.8'
172
env.deb_packages = ['snf-common', 'snf-app', 'snf-cyclades-gtools', 'snf-webproject', 'snf-okeanos-site']
172
env.deb_packages = ['snf-common', 'snf-cyclades-app', 'snf-cyclades-gtools', 'snf-webproject', 'snf-okeanos-site']
173 173
env.signdebs = True
174 174
env.debrelease = False  # Increase release number in Debian changelogs
175 175

  
b/runtests-venvs.sh
46 46
cd snf-common
47 47
rm -rf build dist
48 48
python setup.py install
49
cd ../snf-app
49
cd ../snf-cyclades-app
50 50
rm -rf build dist
51 51
python setup.py install
52 52
cd ../snf-cyclades-gtools
......
72 72
#cd snf-common
73 73
#rm -rf build dist
74 74
#python setup.py install
75
#cd ../snf-app
75
#cd ../snf-cyclades-app
76 76
#rm -rf build dist
77 77
#python setup.py install
78 78
#cd ../snf-cyclades-gtools
b/runtests.sh
37 37

  
38 38
set -e
39 39

  
40
echo "Running snf-app tests..." >&2
40
echo "Running snf-cyclades-app tests..." >&2
41 41
python snf-manage test aai admin api db helpdesk invitations logic userdata --settings=synnefo.settings.test
42 42

  
43 43
echo "Running snf-cyclades-gtools tests..." >&2
/dev/null
1
Copyright 2011 GRNET S.A. All rights reserved.
2

  
3
Redistribution and use in source and binary forms, with or
4
without modification, are permitted provided that the following
5
conditions are met:
6

  
7
  1. Redistributions of source code must retain the above
8
     copyright notice, this list of conditions and the following
9
     disclaimer.
10

  
11
  2. Redistributions in binary form must reproduce the above
12
     copyright notice, this list of conditions and the following
13
     disclaimer in the documentation and/or other materials
14
     provided with the distribution.
15

  
16
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
POSSIBILITY OF SUCH DAMAGE.
28

  
29
The views and conclusions contained in the software and
30
documentation are those of the authors and should not be
31
interpreted as representing official policies, either expressed
32
or implied, of GRNET S.A.
/dev/null
1
Changelog
2
---------
3

  
4
2011-11-29, v0.7.4
5
******************
6

  
7
FIXES:
8
	OKEANOS_INTRO:
9
		* News section
10

  
11

  
12
2011-10-21, v0.7.3
13
******************
14

  
15
FIXES:
16
	UI:
17
		* Fix two UI glitches with Firefox 3.6 (#1545, #1546)
18

  
19

  
20
2011-10-19, v0.7.2
21
******************
22

  
23
FIXES:
24
    UI:
25
	    * Fix regressions with flavor sorting and image size checking
26
		  (#1429, #1507)
27

  
28

  
29
2011-10-17, v0.7.1
30
******************
31

  
32
FIXES:
33
    UI:
34
        * Fix Enter/Esc on machine rename not working in the UI (#1501)
35
	    * Fix UI barfs if a VM is based on an Image with state=DELETED (#1494)
36
        * Fix UI user logout action does not work (#1497)
37
    Images:	
38
		* Fix erroneous reference to $(HELPER_DIR) in /etc/default /snf-image (#1498)
39
		* Fix typo in snf-image-helper ChangePassword task (#1500)
40
		* Show timestamps on execution of helper tasks in snf-image helper VM (#1499)
41
    Deployment:
42
		* Improve check for Ganeti master in snf-ganeti-eventd init script (#1323)
43
		* Fix snf-ganeti-eventd init script ignored defaults file (#1505)
44

  
45

  
46
2011-10-13, v0.7
47
****************
48

  
49
NEW FEATURES:
50
    UI:
51
        * From the ground-up rebuilt, refactored MVC-based UI (#1443)
52
        * Document all settings introduced due to UI refactoring (#1447)
53
        * UI asset files versioning (#1460)
54
        * Improve feedback on completed steps during machine creation (#1461)
55
    Images:
56
        * Completely re-engineered image deployment mechanism based on
57
          snf-image Ganeti OS provider, in isolated helper VM
58
        * Support public and private images (#555)
59
        * Support handling of VM filesystem, injection of arbitrary files
60
          on VM creation (#491)
61
        * Implement file injection as a task in snf-image (#1095)
62
        * Remove all-host based processing of (potentially user-provided)
63
          Images (#969)
64
    API:
65
        * Implement <personality> tag in OpenStack Compute API
66
          for file injection (#985, #1093)
67
        * Update API implementation for server/image metadata based on latest
68
          draft version of spec (#1403)
69
        * Support deletion of Flavors, support servers referring to
70
          inexistent (deleted) Flavors (#1157)
71
    Admin:
72
        * Addition of --meta option to snf-admin image for easy setting
73
          of image metadata values on image creation (#1107)
74
    Deployment:
75
        * Initial iteration of a system test suite, snf-burnin,
76
          for end-to-end testing of Synnefo deployments (#1155)
77
        * Re-engineered logging mechanism, for finer-grained control (#1033)
78
        * Add init script for snf-ganeti-eventd, fix Debian packaging (#1323)
79
        * Document removal of Flavors from circulation (#1472)
80
        * Add generic service unavailable template (#1359)
81

  
82

  
83
FIXES:
84
    UI:
85
        * Fix problems when reusing the Create machine wizard with IE8 (#997)
86
        * Fix problematic update of the networks tab and minor fixes (#861)
87
        * Fix "Connecting" and "progress" gif in networks tab (#863)
88
        * Fix inconsistencies on machine transitions between views (#917)
89
        * Fix IE rendering mode (#975)
90
        * Fix UI machine/network creation overlays style clutter (#979)
91
        * Have UI should reset action confirmations after state change (#981)
92
        * UI barfs due to exception on "New Machine" wizard (#1473)
93
        * UI throws exception on single-server view (#1483)
94
    API:
95
        * Fix incomplete constraints in ImageMetadata Model (#1255)
96
    Deployment:
97
        * Split initial_data.json to work around South "feature" (#1263)
98
        * Fix missing snf-ganeti-instance-image package dependency (#1319)
99
    Kamaki:
100
        * The kamaki client lib uses the root logger (#1337)
101
        * The kamaki client lib fails to set server metadata (#1399)
102
    Invitations:
103
        * FIx bug causing HTTP 500 error on /invitations/login (#1407)
104
        * Fix sort order of flavors, sort by actual characteristicts (#1429)
105
        * Fix display of error modal boxes, do notrefresh or display another
106
          error (#1433)
107
        * Fix positioning of machines in "Destroying" (#1437)
108
        * Fix Metadata button shown as clickable while it's not (#1441)
109
    Images:
110
        * Missing dependency on 'qemu-img' in snf-image-helper (#1484)
111
    Logic:
112
        * Fix messages left in the queue due to unknown Ganeti opcodes (#1492)
113

  
114

  
115
2011-09-15, v0.6.2
116
******************
117

  
118
FIXES:
119
    UI:
120
        * Fix handling of Images in state=DELETED,
121
          allow sorting and categorization of Images in the UI (#823)
122
        * Fix the "Create New wizard" does not honor selection of
123
          "small/medium/large" images (#1129)
124
    Admin:
125
        * Fix the admin interface throws exception on the
126
          Invitations tab (1105)
127
    API:
128
        * Make API responses uncacheable (#1091)
129
    Logic:
130
        * Fix The dispatcher leaving messages unprocessed for
131
          unknown Ganeti opcodes(#1111)
132

  
133
NEW FEATURES:
134
    Admin:
135
        * Support filtering based on state, support image registration
136
          with mandatory type argument, make all deletion operations
137
          set state to DELETED (#849)
138
    API:
139
        * Allow marking flavors as removed, honor deleted flag (#1055)
140

  
141

  
142
2011-09-13, v0.6.1
143
******************
144

  
145
FIXES:
146
    UI:
147
        * Make all AJAX requests to the API uncache-able
148

  
149

  
150
2011-09-12, v0.6
151
****************
152

  
153
NEW FEATURES:
154
    Admin:
155
        * Initial version of new Web-based admininstration panel, allows
156
          management of Synnefo entities directly on the DB (#849)
157
        * Allow setting https apiurl and token in cloud tool (#853)
158
    Deployment:
159
        * Overhauled reconciliation mechanism, unit tests (#1021, #811)
160
    UI:
161
        * Overhaul CPU/RAM/disk sliders in UI to be more intuitive (#843)
162
        * Support setting of small, medium large flavors in UI (#815)
163
        * Have the UI filter flavors, depending on image size (#817)
164
        * Better, error-specific handling of error codes in UI (#971)
165
        * Implement retrieval of authentication token from the UI (#977)
166
        * Re-worked invitation UI is more vocal on errors, supports pagination
167
          (#1039)
168
        * Support a list of UI-specific metadata keys to be copied from Image
169
          to newly-created Server (#847)
170
    Images:
171
        * Support dd-based deployment of Windows and Linux images, using only
172
          dd-based sequential I/O, get rid of ntfsclone (#965, #1007)
173

  
174
FIXES:
175
    UI:
176
        * Fix Opera failing with "too old changes-since value" when idle (#521)
177
        * Fix UI problems with Firefox 3.5.x (#781)
178
        * Fix server statistics not refreshing properly in the UI (#881)
179
        * Machine rename icon not visible on IE (#909)
180
        * Fix list view fail not updating machine state properly (#915)
181
        * Fix colors in "Error" state (#953)
182
        * Fix the confirmation bar disappearing at times (#955)
183
        * Hide all actions when in state "Destroying..." (#957)
184
        * Disable connect action when machine has no ip set (#983)
185
        * Update image details on last vm creation step overlay on IE (#1011)
186
        * Fix list view displays UI error when servers are updated on IE
187
          (#1013)
188
        * Make "Add invitation", remove invitation button appear clickable
189
          (#1019)
190
    Logic:
191
        * Fix Logic layer complaining about certain Ganeti opcodes (#1031)
192

  
193

  
194
2011-08-29, v0.5.5
195
******************
196

  
197
FIXES:
198
    Logic:
199
        * Bugfixes, reconnect to AMQP properly when connection drops,
200
          added more DEBUG- and INFO-level logging messages.
201

  
202

  
203
2011-07-27, v0.5.4
204
******************
205

  
206
FIXES:
207
    UI:
208
        * Numerous bugfixes, most in response to user feedback from
209
          the Alpha deployment
210
        * #813 (Minor UI issues), #857 (long machine names),
211
          #865 (problem when user has zero invitations),
212
          #873 (generic 404 template), #895 (default username in RDP file),
213
          #897 (show spinner for the public network), 899 (allow Connect
214
          from the network UI), #901 (cannot select password for copying
215
          with Chrome), #893 (firewall profile selection behaves as a single
216
          list for all servers), #903 (cannot copy paste IPv4 in icon view),
217
          #905 (Javascript throws exception when left idle), #907 (similar
218
          issue with #907), #913 (list view alert message)
219
    Images:
220
        * ntfsclone does not use all of the available space on the target (#879)
221
    Deployment:
222
        * Move fix_amqp_settings to queue system init code (#809)
223
    Admin:
224
        * snf-admin user invite is not non-ascii friendly (#943)
225
        * snf-user should show email addresses, even without any arguments (#871)
226

  
227
FEATURES:
228
    UI:
229
        * Show completion percentage when a machine is being built (#887)
230
    API:
231
        * Report percentage completion for machines in BUILD (#891)
232
    Images:
233
        * The image deployment layer should report completion to the API layer
234
          (#889)
235
    Deployment:
236
        * Drop ganeti-eventd & snf-ganeti-hook synnefo dependency (#691)
237
        * Split Synnefo Ganeti tools to separate project under snf-cyclades-gtools/
238
        * Import code for building Debian packages, refactor repository (#691)
239

  
240

  
241
2011-07-19, v0.5.3.1
242
******************--
243

  
244
FIXES:
245
    API:
246
        * Fix bug with firewall code using inexistent, removed setting
247
    GUI:
248
        * Fix bug with invitations UI (#859)
249
        * Fix bug with feedback form submission raising HTTP 500
250
    Deployment:
251
        * Fix bug with error reporting by the invitations app
252

  
253

  
254
2011-07-19, v0.5.3
255
******************
256

  
257
FIXES:
258
    GUI:
259
        * Add separate LOGOUT_URL setting
260
          fixes bug with URL in invitations mail
261
    Deployment:
262
        * Recode invitations email in UTF-8
263
        * Use DEFAULT_FROM_EMAIL Django setting as From: header
264
          for all emails
265

  
266

  
267
2011-07-18, v0.5.2
268
******************
269

  
270
FIXES:
271
    GUI:
272
        * Improve IPv6 support in UI (#839, #841)
273
        * Improve Connect messages, propose username (#801)
274
        * Add "tag"/"value" headers in Modify tags popup (#845)
275
    API:
276
        * Support arbitrary arguments to RAPI CreateInstanceCall() (#835)
277
    Admin tool:
278
        * Support creation and modification of users, flavors, images (#827)
279
        * Support sending invitations from the command line
280

  
281

  
282
2011-07-14, v0.5.1
283
******************
284

  
285
FIXES:
286
    GUI:
287
        * non-standard dpi settings (#343)
288
        * many minor bugs (#717)
289
        * remove "Login again" button from Java VNC viewer (#731)
290
        * Fix no firewall settings shown for newly built machines (#753)
291
        * Fix handling of transitional "Destroying" state (#771)
292
        * Use well-formed, client- and server-specific messages
293
          for the Connect operation (#801)
294
        * Fix misaligned action labels in IE (#821)
295
          generic cross-browser compatibility fixes (#341)
296
    Logic:
297
        * fix dispatcher flushing AMQP queues (#719)
298
        * Support asynchronous VM deletion (#721)
299
        * Add backend prefix to all AMQP queues (#723)
300
        * Document workarounds for dispatcher daemonization problems
301
          when logging to stdout (#779)
302
    Images:
303
        * Fix ntfsclone causing excess I/O load due to verbose output (#729)
304
    API:
305
        * Have API use the flavor-defined disk sizes (#759)
306
        * Make backend disk templates (plain, drbd) configurable (#77&)
307
        * Work around Ganeti bug with getting VNC console info (#783)
308
        * Set serial_console=False explicitly on Ganeti backend (#785)
309
        * Allow exception info to propagate when VNC console allocation fails
310
          (#789)
311
        * Handle deletion of machines in ERROR when no Ganeti instance exists
312
          (#799)
313
    Backend:
314
        * Synchronize contrib/kvm-vif-bridge to agree with the API on the tags
315
          to use for firewall profiles (#789)
316

  
317
NEW FEATURES
318
    GUI:
319
        * Add themed form for invitations, integrate with UI (#439)
320
        * Add themed feedback form, integrate with API error window
321
          (~okeanos #7)
322
    Admin tool:
323
        * Add initial version of snf-admin tool for user, VM and image
324
          management (#727)
325

  
326

  
327
2011-07-01, v0.5
328
****************
329

  
330
NEW FEATURES
331
    GUI:
332
        * Overhauled icon and single-server view, updated color set
333
          (#651, #653, #667, #669, #673, #675, #677, #443, #631)
334
        * Added statistics, retrieves pre-processed PNGs from backend (#527)
335
        * Added buttons for modifier keys, custom theming to Java VNC client
336
          (#545)
337
        * Support single-click RDP-based connection to Windows VMs (#673)
338
        * Allow setting network firewall profiles on public interfaces (#661)
339
    Images:
340
        * Complete set of Linux distribution Images (Debian, Fedora, Ubuntu)
341
          (#493, #509)
342
        * Complete support for Windows machines (create, customize, boot)
343
          (#495)
344
    Logic:
345
        * Support centralized logging, logging.conf-based setup (#547)
346
    AAI:
347
        * Allow per-user setting of number of outgoing invitations (#439, #705)
348
        * Support "switch-user"-type functionality for helpdesk users (#665)
349
        * Support user logout in the UI, delete relevant tokens (#663)
350
    API:
351
        * Supports retrieval of statistics (#527)
352
        * Support maximum number of VMs per user (quota) (#703)
353
        * Extend API to support distinct firewall profiles, update backend (#659)
354
    Deployment:
355
        * BSD 2-clause Licensing (#581)
356
        * Initial translation of UI to Greek (#689)
357
        * Drop Django dependency in snf-ganeti-eventd and snf-ganeti-hook (#691)
358
          Synnefo dependency remains, already patched by ops, to be committed
359
        * Split settings.py to distinct files under settings.d/ (#693)
360
        * Use the Django email framework (#697)
361
        * Implemented statistics-gathering mechanism at the backend (#527)
362

  
363
FIXES:
364
    GUI:
365
        * Too many bug fixes to mention (#403, #429, #465, #473, #557, #589,
366
          #599, #605, #607, #609, #611, #613, #619, #621, #623, #625, #627,
367
          #629, #633, #635, #637, #639, #641, #643, #645, #647, #649, #655,
368
          #657, #681, #687, #699, #701, #707, #709)
369
        * Better cross-browser compatibility (#341)
370
        * Should work with relative URLs (#421)
371
    Images:
372
        * Set hostname in Linux VMs appropriately (#603)
373
    Logic:
374
        * Include EUI-64-derived IPv6 address in ganeti-net-status notifications
375
          (#615)
376
    Deployment:
377
        * Do not set nodes explicitly, use iallocator at Ganeti backend (#617)
378

  
379

  
380
2011-06-06, v0.4
381
****************
382

  
383
NEW FEATURES:
384
    GUI:
385
        * Support displaying info on and handling of public and private networks,
386
          with differential updates (#407, #469)
387
        * Support create new private network (#541), add machine to
388
          private network (#543)
389
        * Design and implement a completely revamped blue and orange
390
          color theme (#529, #531)
391
        * Implement improved add/edit metadata dialog with suggested values for
392
          keys (#535, #537)
393
        * Implement list of suggested keys in add server metadata dialog (#537)
394
        * Add full-screen Console window, themed as the rest of the UI (#497)
395
        * Implement single-machine view in the UI (#573)
396
        * Add user notification (spinner) on button clicks performing
397
          API actions (#471)
398
        * Full IE support, differential updates (#461)
399
    AAI:
400
        * Each token has its own expiration date, fix expiration of
401
          development test token (#483)
402
        * Support adding new users to the DB by invitation (#439)
403
    API:
404
        * Extend networks API, support differential updates for private nets (#569)
405
        * Support XML replies for the /networks API namespace (#553)
406
        * Implement mechanism for reconciliation of DB state with Ganeti backend
407
          state in case of AMQP failure (#505)
408
        * Support Ganeti link pooling for management of private networks (#513)
409
        * Support reception and processing of NIC configuration notifications
410
          from Ganeti over AMQP (#513)
411
    IMAGES:
412
        * Implement generic API<->Ganeti mechanism for passing custom VM parameters (#487)
413
        * Support selection and handling of OS images for VM customization (#489)
414
        * Support random selection and enforcement of root password on Linux VMs (#485)
415
    GANETI BACKEND:
416
        * Design and implement mechanism for handling network connection requests,
417
          based on link ids of virtual NICs (#411)
418
        * Support handling of public and private networks,
419
          based on NFDHCPD and custom KVM ifup scripts (#407, #411)
420

  
421
FIXES:
422
    GUI:
423
        * Remove extraneous GET /server/id/meta requests (#463)
424
        * Fix location of the "Create New" wizard in IE (#467)
425
        * Make numerous hardcoded strings translatable (#473)
426
        * Fix alignment of step names in "Create New" wizard (#475)
427
        * Fix OS icons not appearing in Opera (#477)
428
        * Fix correspondence of OS icons to icon URIs (#481)
429
        * Fix console action inoperable in list view (#497)
430
        * Fix HTTP errors from backend not reported correctly (#523)
431
        * Fix handling of API "UKNNOWN" status for servers (#571)
432
        * Add SVG-derived icons for Fedora in multiple resolutions (#587)
433
        * Various minor UI glitches (#583, #585, #591)
434
    API:
435
        * Fix entering Greek characters in fields failed (was due to
436
          problem with db creation parameters in MySQL) (#499)
437
        * Fix return erroneous 304 NOT MOTIFIED for GET /servers if only
438
          server metadata modified (#525)
439
        * Fix return erroneous "UNKNOWN" status under specific circumstances (#573)
440
        * Remove private network connections when a server is deleted (#579)
441

  
442

  
443
KNOWN DEFECTS:
444

  
445
    GUI:
446
        * Does not work with relative URLs (cannot deploy under subdir) (#421)
447
        * UI breaks if "Create New" called twice in quick succession (#609)
448
        * Esc/Enter keys do not work in edit metadata window (#605)
449
        * No spinner icon on outstanding requests for updates to private networks (#607)
450
        * Error window overflows in case of longer-than-usual traceback in
451
          "Details" field (#611)
452
        * Single-server view does not update properly (#613)
453
    IMAGES:
454
        * Image deployment mechanism does not set Linux hostname properly (#603)
455
    GANETI BACKEND:
456
        * No IPv6 reported from the Synnefo Ganeti hook to the API
457
          (backend, API and UI can all handle IPv6 though) (#615)
458
        * All VMs currently allocated to the first Ganeti node, since no
459
          allocator has been installed in the development Ganeti yet (#617)
460
    Deployment:
461
        * No rigorous testing of data migration, migrations in real-world
462
          conditions will probably fail (#503)
463

  
464

  
465
2011-05-10, v0.3
466
****************
467

  
468
FIXES/NEW FEATURES:
469

  
470
    GUI:
471
        * Report connection failures correctly, instead of a bogus 503 error (#427)
472
        * Support rename Virtual Machines using a nifty pencil icon (#429)
473
        * Fix complete failure of site with IE (starts, has known defects) (#431)
474
        * Support expanding box in icon view, containing metadata info (#375, #435, #441)
475
        * Support providing X-Auth-Token headers for authentication (#455)
476
        * Support Java applet-based popup for VNC console access (#391)
477
        * Initial implementation of "networks" tab interface mockup, no actual functionality (#415)
478
    AAI:
479
        * End-to-end Shibboleth support (#345)
480
    API:
481
        * Support creation, management and removal of private L2 networks (#409, #457)
482
        * Fix API implementation does not return unAuthorized cloud faults (#459)
483
        * Merge support for X-Auth-Token based authentication (#423)
484
    Logic:
485
        * Re-engineer messaging layer, migrate from 0mq to an AMQP-based infrastructure (#393)
486
        * Extended dispatcher, provides the context for executing business layer functions (#393)
487
        * Extended Ganeti event daemon, publish notifications over AMQP (#393)
488
        * Support a generic Synnefo hook in Ganeti, publish notifications over AMQP (#393, #397)
489
        * Extend logic layer, process NIC configuration notifications, update VM info in DB (#397)
490
    Deployment:
491
        * Add improved version of README.deploy, detailing node types in a Synnefo deployment
492

  
493
KNOWN DEFECTS:
494

  
495
    GUI:
496
        * Inoperative console action in list view (#497)
497
        * Various UI glitches under Chrome/Safari (wizard)
498
        * Serious functionality glitches with IE (no auto-refresh, no machine rename)
499
        * Serious UI glitches with non-standard dpi settings (#343)
500
        * Does not work with relative URLs (cannot deploy under subdir) (#421)
501
    API:
502
        * No Greek characters allowed in server names with the MySQL backend (#499)
503
    Deployment:
504
        * No rigorous testing of data migration, migrations in real-world conditions will probably fail (#503)
505

  
506

  
507
2011-04-19, v0.2.2
508
******************
509

  
510
Bug fix release:
511
    GUI:
512
        * Fix start operation breakage due to extra argument in API call (#433)
513

  
514

  
515
2011-04-19, v0.2.1
516
******************
517

  
518
Bug fix release:
519
    GUI:
520
        * Fix shutdown operation breakage due to extra argument in API call (#433)
521

  
522

  
523
2011-04-19, v0.2
524
****************
525

  
526
FIXES/NEW FEATURES:
527

  
528
    GUI:
529
        * Show transitional state when command is in progress ("Starting", etc) (#401)
530
        * Allow only "destroy" for machines being built (#399)
531
        * Show nice icons for the icon, list and single view (#389)
532
        * Show the VM configuration (flavor) in list view (#387)
533
        * Add Destroy action in icon view (#381)
534
        * Show spinner when action is in progress (#379)
535
        * Handle OS icons properly for Images and machines, user-controlled (#257)
536
        * Support modification of VM metadata (currently: only addition, removal) (#375)
537
        * Support machine rename (#307)
538
        * Show welcome screen when no VMs defined (#279)
539
        * Revamped "Create New" wizard (#83)
540
    API:
541
        * Return buildInProgress properly (#351)
542
        * Loads of new unit tests (#417)
543
        * Support OOB console access over VNC using vncauthproxy
544
            - Run as daemon, support automatic port selection (#419)
545
        * Refactor ganeti-0mqd
546
            - Run as daemon, receive messages from Ganeti hooks, publish over 0mq
547
    Deployment:
548
        * Add initial version of README.deploy, detailing service dependencies
549
        * Add support for database migrations, using Django South (#371)
550
        * Install continuous integration platform (Jenkins), run tests automatically (#383)
551

  
552
KNOWN DEFECTS:
553

  
554
    GUI:
555
        * Minor visual problems with Firefox 3.5 (#403)
556
        * Major cross-browser compatibility problems (no IE support) (#431, #341)
557
        * Requires installation under /, does not work with relative URLs (#421)
558
        * Incorrect 503 return code when server is unreachable (#427)
/dev/null
1
recursive-include synnefo *.json *.html *.json *.xml *.txt
2
recursive-include synnefo/admin/static *
3
recursive-include synnefo/ui/static *
4
recursive-include docs/ *.rst
5

  
6
include README Changelog
7
include distribute_setup.py
/dev/null
1
README
2
=======
3

  
4
This is the top-level documentation file for the
5
Synnefo cloud management software.
6

  
7
Consult:
8
  * docs/src/develop.rst: for information on how to setup a development environment
9
  * docs/src/install.rst: for information on how to install the application
10
  * docs/src/deploy.rst:  for information on how to deploy the application
11
  * docs/src/ci.rst:      for information on how to setup a Jenkins-based
12
                          continuous integration system
13
  * docs/src/i18n.rst:    for information on application internationalization
14

  
15

  
16
Synnefo may be distributed under the terms of the following license:
17

  
18
Copyright 2011 GRNET S.A. All rights reserved.
19

  
20
Redistribution and use in source and binary forms, with or
21
without modification, are permitted provided that the following
22
conditions are met:
23

  
24
  1. Redistributions of source code must retain the above
25
     copyright notice, this list of conditions and the following
26
     disclaimer.
27

  
28
  2. Redistributions in binary form must reproduce the above
29
     copyright notice, this list of conditions and the following
30
     disclaimer in the documentation and/or other materials
31
     provided with the distribution.
32

  
33
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
34
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
36
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
37
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
40
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
41
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
43
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44
POSSIBILITY OF SUCH DAMAGE.
45

  
46
The views and conclusions contained in the software and
47
documentation are those of the authors and should not be
48
interpreted as representing official policies, either expressed
49
or implied, of GRNET S.A.
/dev/null
1
#!/bin/sh
2
#
3
# This file is a shell script to be sourced by the appropriate 
4
# init.d script
5
#
6

  
7
VERBOSE=yes
8

  
9
# Run as a daemon? true/false
10
SNF_DSPTCH_ENABLE=true
11

  
12
# User to run the dispatcher as
13
SNF_USER="www-data"
14

  
15
# How many workers, default 2
16
WORKERS=2
17

  
18
SNF_DPTCH_OPTS="--workers=2"
/dev/null
1
#!/bin/sh
2

  
3
### BEGIN INIT INFO
4
# Provides:		  snf-dispatcher
5
# Required-Start:	$remote_fs $syslog
6
# Required-Stop:	 $remote_fs $syslog
7
# Default-Start:	 2 3 4 5
8
# Default-Stop:	  0 1 6
9
# Short-Description: Synnefo dispatcher daemon
10
# Description:	   Dispatcher is a daemon for the synnefo middleware logic layer
11
### END INIT INFO
12

  
13
set -e
14

  
15
# /etc/init.d/snf-dispatcher: start and stop the dispatcher daemon
16

  
17
DAEMON=/usr/bin/snf-dispatcher
18
SNF_DSPTCH_OPTS=''
19
SNF_DSPTCH_DEFAULTS_FILE=/etc/default/snf-dispatcher
20
SNF_DSPTCH_RUNDIR=/var/run/synnefo
21
SNF_DSPTCH_PID_FILE=$SNF_DSPTCH_RUNDIR/snf_dispatcher.pid
22

  
23
test -x $DAEMON || exit 0
24

  
25
. /lib/lsb/init-functions
26

  
27
if [ -s $SNF_DSPTCH_DEFAULTS_FILE ]; then
28
	. $SNF_DSPTCH_DEFAULTS_FILE
29
	SNF_DSPTCH_OPTS=$SNF_DSPTCH_OPTS" -p $SNF_DSPTCH_PID_FILE"
30
	case "x$SNF_DSPTCH_ENABLE" in
31
	xtrue|xfalse)	;;
32
	*)		log_failure_msg "Value of SNF_DSPTCH_ENABLE in $SNF_DSPTCH_DEFAULTS_FILE must be either 'true' or 'false';"
33
			log_failure_msg "not starting dispatcher daemon."
34
			exit 1
35
			;;
36
	esac
37
fi
38

  
39
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
40

  
41
dispatcher_start() {
42
	if start-stop-daemon --start --chuid $SNF_USER --exec $DAEMON -- $SNF_DSPTCH_OPTS; then
43
		rc=0
44
		sleep 1
45
		if ! kill -0 $(cat $SNF_DSPTCH_PID_FILE) >/dev/null 2>&1; then
46
			log_failure_msg "snf-dispatcher daemon failed to start"
47
			rc=1
48
		fi
49
	else
50
		rc=1
51
	fi
52

  
53
	if [ $rc -eq 0 ]; then
54
		log_end_msg 0
55
	else
56
		log_end_msg 1
57
		rm -f $SNF_DSPTCH_PID_FILE
58
	fi
59
} # dispatcher_start
60

  
61

  
62
case "$1" in
63
  start)
64
	# Ensure the directory containing the pidfile exists
65
	# and has the right permissions
66
        mkdir -p $SNF_DSPTCH_RUNDIR
67
        chown $SNF_USER $SNF_DSPTCH_RUNDIR
68
        chmod 0755 $SNF_DSPTCH_RUNDIR
69

  
70
	if "$SNF_DSPTCH_ENABLE"; then
71
		log_daemon_msg "Starting snf-dispatcher daemon" "snf-dispatcher"
72
		if [ -s $SNF_DSPTCH_PID_FILE ] && kill -0 $(cat $SNF_DSPTCH_PID_FILE) >/dev/null 2>&1; then
73
		log_progress_msg "apparently already running"
74
		log_end_msg 0
75
		exit 0
76
		fi
77
			dispatcher_start
78
		else
79
			[ "$VERBOSE" != no ] && log_warning_msg "snf-dispatcher daemon not enabled in $SNF_DSPTCH_DEFAULTS_FILE, not starting..."
80
	fi
81
	;;
82
  stop)
83
	log_daemon_msg "Stopping snf-dispatcher daemon" "snf-dispatcher"
84
	start-stop-daemon --stop --quiet --oknodo --pidfile $SNF_DSPTCH_PID_FILE
85
	log_end_msg $?
86
	rm -f $SNF_DSPTCH_PID_FILE
87
	;;
88

  
89
  restart)
90
	set +e
91
	if $SNF_DSPTCH_ENABLE; then
92
		log_daemon_msg "Restarting dispatcher daemon" "dispatcher"
93
		if [ -s $SNF_DSPTCH_PID_FILE ] && kill -0 $(cat $SNF_DSPTCH_PID_FILE) >/dev/null 2>&1; then
94
		start-stop-daemon --stop --quiet --oknodo --pidfile $SNF_DSPTCH_PID_FILE || true
95
		sleep 1
96
		else
97
		log_warning_msg "dispatcher daemon not running, attempting to start."
98
			rm -f $SNF_DSPTCH_PID_FILE
99
		fi
100
			dispatcher_start
101
		else
102
			[ "$VERBOSE" != no ] && log_warning_msg "dispatcher daemon not enabled in $SNF_DSPTCH_DEFAULTS_FILE, not starting..."
103
	fi
104
	;;
105

  
106
  status)
107
	status_of_proc -p $SNF_DSPTCH_PID_FILE "$DAEMON" dispatcher
108
	exit $?	# notreached due to set -e
109
	;;
110
  *)
111
	echo "Usage: /etc/init.d/snf-dispatcher {start|stop|restart|status}"
112
	exit 1
113
esac
114

  
115
exit 0
116

  
/dev/null
1
#!python
2
"""Bootstrap distribute installation
3

  
4
If you want to use setuptools in your package's setup.py, just include this
5
file in the same directory with it, and add this to the top of your setup.py::
6

  
7
    from distribute_setup import use_setuptools
8
    use_setuptools()
9

  
10
If you want to require a specific version of setuptools, set a download
11
mirror, or use an alternate download directory, you can do so by supplying
12
the appropriate options to ``use_setuptools()``.
13

  
14
This file can also be run as a script to install or upgrade setuptools.
15
"""
16
import os
17
import sys
18
import time
19
import fnmatch
20
import tempfile
21
import tarfile
22
from distutils import log
23

  
24
try:
25
    from site import USER_SITE
26
except ImportError:
27
    USER_SITE = None
28

  
29
try:
30
    import subprocess
31

  
32
    def _python_cmd(*args):
33
        args = (sys.executable,) + args
34
        return subprocess.call(args) == 0
35

  
36
except ImportError:
37
    # will be used for python 2.3
38
    def _python_cmd(*args):
39
        args = (sys.executable,) + args
40
        # quoting arguments if windows
41
        if sys.platform == 'win32':
42
            def quote(arg):
43
                if ' ' in arg:
44
                    return '"%s"' % arg
45
                return arg
46
            args = [quote(arg) for arg in args]
47
        return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
48

  
49
DEFAULT_VERSION = "0.6.10"
50
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
51
SETUPTOOLS_FAKED_VERSION = "0.6c11"
52

  
53
SETUPTOOLS_PKG_INFO = """\
54
Metadata-Version: 1.0
55
Name: setuptools
56
Version: %s
57
Summary: xxxx
58
Home-page: xxx
59
Author: xxx
60
Author-email: xxx
61
License: xxx
62
Description: xxx
63
""" % SETUPTOOLS_FAKED_VERSION
64

  
65

  
66
def _install(tarball):
67
    # extracting the tarball
68
    tmpdir = tempfile.mkdtemp()
69
    log.warn('Extracting in %s', tmpdir)
70
    old_wd = os.getcwd()
71
    try:
72
        os.chdir(tmpdir)
73
        tar = tarfile.open(tarball)
74
        _extractall(tar)
75
        tar.close()
76

  
77
        # going in the directory
78
        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
79
        os.chdir(subdir)
80
        log.warn('Now working in %s', subdir)
81

  
82
        # installing
83
        log.warn('Installing Distribute')
84
        if not _python_cmd('setup.py', 'install'):
85
            log.warn('Something went wrong during the installation.')
86
            log.warn('See the error message above.')
87
    finally:
88
        os.chdir(old_wd)
89

  
90

  
91
def _build_egg(egg, tarball, to_dir):
92
    # extracting the tarball
93
    tmpdir = tempfile.mkdtemp()
94
    log.warn('Extracting in %s', tmpdir)
95
    old_wd = os.getcwd()
96
    try:
97
        os.chdir(tmpdir)
98
        tar = tarfile.open(tarball)
99
        _extractall(tar)
100
        tar.close()
101

  
102
        # going in the directory
103
        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
104
        os.chdir(subdir)
105
        log.warn('Now working in %s', subdir)
106

  
107
        # building an egg
108
        log.warn('Building a Distribute egg in %s', to_dir)
109
        _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
110

  
111
    finally:
112
        os.chdir(old_wd)
113
    # returning the result
114
    log.warn(egg)
115
    if not os.path.exists(egg):
116
        raise IOError('Could not build the egg.')
117

  
118

  
119
def _do_download(version, download_base, to_dir, download_delay):
120
    egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
121
                       % (version, sys.version_info[0], sys.version_info[1]))
122
    if not os.path.exists(egg):
123
        tarball = download_setuptools(version, download_base,
124
                                      to_dir, download_delay)
125
        _build_egg(egg, tarball, to_dir)
126
    sys.path.insert(0, egg)
127
    import setuptools
128
    setuptools.bootstrap_install_from = egg
129

  
130

  
131
def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
132
                   to_dir=os.curdir, download_delay=15, no_fake=True):
133
    # making sure we use the absolute path
134
    to_dir = os.path.abspath(to_dir)
135
    was_imported = 'pkg_resources' in sys.modules or \
136
        'setuptools' in sys.modules
137
    try:
138
        try:
139
            import pkg_resources
140
            if not hasattr(pkg_resources, '_distribute'):
141
                if not no_fake:
142
                    _fake_setuptools()
143
                raise ImportError
144
        except ImportError:
145
            return _do_download(version, download_base, to_dir, download_delay)
146
        try:
147
            pkg_resources.require("distribute>="+version)
148
            return
149
        except pkg_resources.VersionConflict:
150
            e = sys.exc_info()[1]
151
            if was_imported:
152
                sys.stderr.write(
153
                "The required version of distribute (>=%s) is not available,\n"
154
                "and can't be installed while this script is running. Please\n"
155
                "install a more recent version first, using\n"
156
                "'easy_install -U distribute'."
157
                "\n\n(Currently using %r)\n" % (version, e.args[0]))
158
                sys.exit(2)
159
            else:
160
                del pkg_resources, sys.modules['pkg_resources']    # reload ok
161
                return _do_download(version, download_base, to_dir,
162
                                    download_delay)
163
        except pkg_resources.DistributionNotFound:
164
            return _do_download(version, download_base, to_dir,
165
                                download_delay)
166
    finally:
167
        if not no_fake:
168
            _create_fake_setuptools_pkg_info(to_dir)
169

  
170
def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
171
                        to_dir=os.curdir, delay=15):
172
    """Download distribute from a specified location and return its filename
173

  
174
    `version` should be a valid distribute version number that is available
175
    as an egg for download under the `download_base` URL (which should end
176
    with a '/'). `to_dir` is the directory where the egg will be downloaded.
177
    `delay` is the number of seconds to pause before an actual download
178
    attempt.
179
    """
180
    # making sure we use the absolute path
181
    to_dir = os.path.abspath(to_dir)
182
    try:
183
        from urllib.request import urlopen
184
    except ImportError:
185
        from urllib2 import urlopen
186
    tgz_name = "distribute-%s.tar.gz" % version
187
    url = download_base + tgz_name
188
    saveto = os.path.join(to_dir, tgz_name)
189
    src = dst = None
190
    if not os.path.exists(saveto):  # Avoid repeated downloads
191
        try:
192
            log.warn("Downloading %s", url)
193
            src = urlopen(url)
194
            # Read/write all in one block, so we don't create a corrupt file
195
            # if the download is interrupted.
196
            data = src.read()
197
            dst = open(saveto, "wb")
198
            dst.write(data)
199
        finally:
200
            if src:
201
                src.close()
202
            if dst:
203
                dst.close()
204
    return os.path.realpath(saveto)
205

  
206
def _no_sandbox(function):
207
    def __no_sandbox(*args, **kw):
208
        try:
209
            from setuptools.sandbox import DirectorySandbox
210
            if not hasattr(DirectorySandbox, '_old'):
211
                def violation(*args):
212
                    pass
213
                DirectorySandbox._old = DirectorySandbox._violation
214
                DirectorySandbox._violation = violation
215
                patched = True
216
            else:
217
                patched = False
218
        except ImportError:
219
            patched = False
220

  
221
        try:
222
            return function(*args, **kw)
223
        finally:
224
            if patched:
225
                DirectorySandbox._violation = DirectorySandbox._old
226
                del DirectorySandbox._old
227

  
228
    return __no_sandbox
229

  
230
def _patch_file(path, content):
231
    """Will backup the file then patch it"""
232
    existing_content = open(path).read()
233
    if existing_content == content:
234
        # already patched
235
        log.warn('Already patched.')
236
        return False
237
    log.warn('Patching...')
238
    _rename_path(path)
239
    f = open(path, 'w')
240
    try:
241
        f.write(content)
242
    finally:
243
        f.close()
244
    return True
245

  
246
_patch_file = _no_sandbox(_patch_file)
247

  
248
def _same_content(path, content):
249
    return open(path).read() == content
250

  
251
def _rename_path(path):
252
    new_name = path + '.OLD.%s' % time.time()
253
    log.warn('Renaming %s into %s', path, new_name)
254
    os.rename(path, new_name)
255
    return new_name
256

  
257
def _remove_flat_installation(placeholder):
258
    if not os.path.isdir(placeholder):
259
        log.warn('Unkown installation at %s', placeholder)
260
        return False
261
    found = False
262
    for file in os.listdir(placeholder):
263
        if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
264
            found = True
265
            break
266
    if not found:
267
        log.warn('Could not locate setuptools*.egg-info')
268
        return
269

  
270
    log.warn('Removing elements out of the way...')
271
    pkg_info = os.path.join(placeholder, file)
272
    if os.path.isdir(pkg_info):
273
        patched = _patch_egg_dir(pkg_info)
274
    else:
275
        patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
276

  
277
    if not patched:
278
        log.warn('%s already patched.', pkg_info)
279
        return False
280
    # now let's move the files out of the way
281
    for element in ('setuptools', 'pkg_resources.py', 'site.py'):
282
        element = os.path.join(placeholder, element)
283
        if os.path.exists(element):
284
            _rename_path(element)
285
        else:
286
            log.warn('Could not find the %s element of the '
287
                     'Setuptools distribution', element)
288
    return True
289

  
290
_remove_flat_installation = _no_sandbox(_remove_flat_installation)
291

  
292
def _after_install(dist):
293
    log.warn('After install bootstrap.')
294
    placeholder = dist.get_command_obj('install').install_purelib
295
    _create_fake_setuptools_pkg_info(placeholder)
296

  
297
def _create_fake_setuptools_pkg_info(placeholder):
298
    if not placeholder or not os.path.exists(placeholder):
299
        log.warn('Could not find the install location')
300
        return
301
    pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
302
    setuptools_file = 'setuptools-%s-py%s.egg-info' % \
303
            (SETUPTOOLS_FAKED_VERSION, pyver)
304
    pkg_info = os.path.join(placeholder, setuptools_file)
305
    if os.path.exists(pkg_info):
306
        log.warn('%s already exists', pkg_info)
307
        return
308

  
309
    log.warn('Creating %s', pkg_info)
310
    f = open(pkg_info, 'w')
311
    try:
312
        f.write(SETUPTOOLS_PKG_INFO)
313
    finally:
314
        f.close()
315

  
316
    pth_file = os.path.join(placeholder, 'setuptools.pth')
317
    log.warn('Creating %s', pth_file)
318
    f = open(pth_file, 'w')
319
    try:
320
        f.write(os.path.join(os.curdir, setuptools_file))
321
    finally:
322
        f.close()
323

  
324
_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
325

  
326
def _patch_egg_dir(path):
327
    # let's check if it's already patched
328
    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
329
    if os.path.exists(pkg_info):
330
        if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
331
            log.warn('%s already patched.', pkg_info)
332
            return False
333
    _rename_path(path)
334
    os.mkdir(path)
335
    os.mkdir(os.path.join(path, 'EGG-INFO'))
336
    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
337
    f = open(pkg_info, 'w')
338
    try:
339
        f.write(SETUPTOOLS_PKG_INFO)
340
    finally:
341
        f.close()
342
    return True
343

  
344
_patch_egg_dir = _no_sandbox(_patch_egg_dir)
345

  
346
def _before_install():
347
    log.warn('Before install bootstrap.')
348
    _fake_setuptools()
349

  
350

  
351
def _under_prefix(location):
352
    if 'install' not in sys.argv:
353
        return True
354
    args = sys.argv[sys.argv.index('install')+1:]
355
    for index, arg in enumerate(args):
356
        for option in ('--root', '--prefix'):
357
            if arg.startswith('%s=' % option):
358
                top_dir = arg.split('root=')[-1]
359
                return location.startswith(top_dir)
360
            elif arg == option:
361
                if len(args) > index:
362
                    top_dir = args[index+1]
363
                    return location.startswith(top_dir)
364
        if arg == '--user' and USER_SITE is not None:
365
            return location.startswith(USER_SITE)
366
    return True
367

  
368

  
369
def _fake_setuptools():
370
    log.warn('Scanning installed packages')
371
    try:
372
        import pkg_resources
373
    except ImportError:
374
        # we're cool
375
        log.warn('Setuptools or Distribute does not seem to be installed.')
376
        return
377
    ws = pkg_resources.working_set
378
    try:
379
        setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
380
                                  replacement=False))
381
    except TypeError:
382
        # old distribute API
383
        setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
384

  
385
    if setuptools_dist is None:
386
        log.warn('No setuptools distribution found')
387
        return
388
    # detecting if it was already faked
389
    setuptools_location = setuptools_dist.location
390
    log.warn('Setuptools installation detected at %s', setuptools_location)
391

  
392
    # if --root or --preix was provided, and if
393
    # setuptools is not located in them, we don't patch it
394
    if not _under_prefix(setuptools_location):
395
        log.warn('Not patching, --root or --prefix is installing Distribute'
396
                 ' in another location')
397
        return
398

  
399
    # let's see if its an egg
400
    if not setuptools_location.endswith('.egg'):
401
        log.warn('Non-egg installation')
402
        res = _remove_flat_installation(setuptools_location)
403
        if not res:
404
            return
405
    else:
406
        log.warn('Egg installation')
407
        pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
408
        if (os.path.exists(pkg_info) and
409
            _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
410
            log.warn('Already patched.')
411
            return
412
        log.warn('Patching...')
413
        # let's create a fake egg replacing setuptools one
414
        res = _patch_egg_dir(setuptools_location)
415
        if not res:
416
            return
417
    log.warn('Patched done.')
418
    _relaunch()
419

  
420

  
421
def _relaunch():
422
    log.warn('Relaunching...')
423
    # we have to relaunch the process
424
    # pip marker to avoid a relaunch bug
425
    if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
426
        sys.argv[0] = 'setup.py'
427
    args = [sys.executable] + sys.argv
428
    sys.exit(subprocess.call(args))
429

  
430

  
431
def _extractall(self, path=".", members=None):
432
    """Extract all members from the archive to the current working
433
       directory and set owner, modification time and permissions on
434
       directories afterwards. `path' specifies a different directory
435
       to extract to. `members' is optional and must be a subset of the
436
       list returned by getmembers().
437
    """
438
    import copy
439
    import operator
440
    from tarfile import ExtractError
441
    directories = []
442

  
443
    if members is None:
444
        members = self
445

  
446
    for tarinfo in members:
447
        if tarinfo.isdir():
448
            # Extract directories with a safe mode.
449
            directories.append(tarinfo)
450
            tarinfo = copy.copy(tarinfo)
451
            tarinfo.mode = 448 # decimal for oct 0700
452
        self.extract(tarinfo, path)
453

  
454
    # Reverse sort directories.
455
    if sys.version_info < (2, 4):
456
        def sorter(dir1, dir2):
457
            return cmp(dir1.name, dir2.name)
458
        directories.sort(sorter)
459
        directories.reverse()
460
    else:
461
        directories.sort(key=operator.attrgetter('name'), reverse=True)
462

  
463
    # Set correct owner, mtime and filemode on directories.
464
    for tarinfo in directories:
465
        dirpath = os.path.join(path, tarinfo.name)
466
        try:
467
            self.chown(tarinfo, dirpath)
468
            self.utime(tarinfo, dirpath)
469
            self.chmod(tarinfo, dirpath)
470
        except ExtractError:
471
            e = sys.exc_info()[1]
472
            if self.errorlevel > 1:
473
                raise
474
            else:
475
                self._dbg(1, "tarfile: %s" % e)
476

  
477

  
478
def main(argv, version=DEFAULT_VERSION):
479
    """Install or upgrade setuptools and EasyInstall"""
480
    tarball = download_setuptools()
481
    _install(tarball)
482

  
483

  
484
if __name__ == '__main__':
485
    main(sys.argv[1:])
/dev/null
1
# Makefile for Sphinx documentation
2
#
3

  
4
# You can set these variables from the command line.
5
SPHINXOPTS    =
6
SPHINXBUILD   = sphinx-build
7
PAPER         =
8
BUILDDIR      = _build
9

  
10
# Internal variables.
11
PAPEROPT_a4     = -D latex_paper_size=a4
12
PAPEROPT_letter = -D latex_paper_size=letter
13
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14
# the i18n builder cannot share the environment and doctrees with the others
15
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16

  
17
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
18

  
19
help:
20
	@echo "Please use \`make <target>' where <target> is one of"
21
	@echo "  html       to make standalone HTML files"
22
	@echo "  dirhtml    to make HTML files named index.html in directories"
23
	@echo "  singlehtml to make a single large HTML file"
24
	@echo "  pickle     to make pickle files"
25
	@echo "  json       to make JSON files"
26
	@echo "  htmlhelp   to make HTML files and a HTML help project"
27
	@echo "  qthelp     to make HTML files and a qthelp project"
28
	@echo "  devhelp    to make HTML files and a Devhelp project"
29
	@echo "  epub       to make an epub"
30
	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
31
	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
32
	@echo "  text       to make text files"
33
	@echo "  man        to make manual pages"
34
	@echo "  texinfo    to make Texinfo files"
35
	@echo "  info       to make Texinfo files and run them through makeinfo"
36
	@echo "  gettext    to make PO message catalogs"
37
	@echo "  changes    to make an overview of all changed/added/deprecated items"
38
	@echo "  linkcheck  to check all external links for integrity"
39
	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
40

  
41
clean:
42
	-rm -rf $(BUILDDIR)/*
43

  
44
html:
45
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
46
	@echo
47
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
48

  
49
dirhtml:
50
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
51
	@echo
52
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
53

  
54
singlehtml:
55
	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
56
	@echo
57
	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
58

  
59
pickle:
60
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
61
	@echo
62
	@echo "Build finished; now you can process the pickle files."
63

  
64
json:
65
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
66
	@echo
67
	@echo "Build finished; now you can process the JSON files."
68

  
69
htmlhelp:
70
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
71
	@echo
72
	@echo "Build finished; now you can run HTML Help Workshop with the" \
73
	      ".hhp project file in $(BUILDDIR)/htmlhelp."
74

  
75
qthelp:
76
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
77
	@echo
78
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
79
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
80
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/synnefo.qhcp"
81
	@echo "To view the help file:"
82
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/synnefo.qhc"
83

  
84
devhelp:
85
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
86
	@echo
87
	@echo "Build finished."
88
	@echo "To view the help file:"
89
	@echo "# mkdir -p $$HOME/.local/share/devhelp/synnefo"
90
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/synnefo"
91
	@echo "# devhelp"
92

  
93
epub:
94
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
95
	@echo
96
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
97

  
98
latex:
99
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
100
	@echo
101
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
102
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
103
	      "(use \`make latexpdf' here to do that automatically)."
104

  
105
latexpdf:
106
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
107
	@echo "Running LaTeX files through pdflatex..."
108
	$(MAKE) -C $(BUILDDIR)/latex all-pdf
109
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
110

  
111
text:
112
	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
113
	@echo
114
	@echo "Build finished. The text files are in $(BUILDDIR)/text."
115

  
116
man:
117
	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
118
	@echo
119
	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
120

  
121
texinfo:
122
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
123
	@echo
124
	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
125
	@echo "Run \`make' in that directory to run these through makeinfo" \
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff